Skip to content

fix(memory): avoid WebKit scrollbar timeline allocation growth - #1115

Merged
xintaofei merged 3 commits into
spacering-net:mainfrom
kogekiplay:fix/memory-webkit-latest
Nov 10, 2026
Merged

xintaofei merged 3 commits into
spacering-net:mainfrom
kogekiplay:fix/memory-webkit-latest

Conversation

@kogekiplay

@kogekiplay kogekiplay commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

WebKit 的 OverlayScrollbars 原生 ScrollTimeline 路径在反复滚动时持续保留 native allocations。这个 PR 对 WebKit 使用库原有的 scroll-event 实现,并对 handle 使用百分比定位;Chromium 保留原生 timeline 路径。

按维护者在 #1097 中的建议拆出的第 1 批,可独立安装、审阅和发布。分支直接基于最新官方 main:5c03d7af865f54cf42a994327daf2c45ab4a946f。依赖补丁配置和 lockfile 仅包含本批 OverlayScrollbars 补丁。

改动与验证:

  • 同步修补包的四个 ESM/CommonJS 入口和 CSS,添加安装后真实入口回归测试,覆盖 WebKit/iOS、Chromium 及无 ScrollTimeline 的环境。
  • 从干净的工作树执行 pnpm install --frozen-lockfile,补丁生效;完整 TypeScript(包含测试)、ESLint 和 production build 已验证。
  • 用该工作树安装的包进行系统 WKWebView 原生 footprint 对照:24 个滚动区域,原路径在最初约 20 秒达到 1,770.6 MiB 并触发实验停止阈值;修复后连续运行 120 秒,footprint 范围 208.9–276.7 MiB,最后采样 215.4 MiB,9,170 帧,零 scrollbar ScrollTimeline animations,handle 持续移动。
  • 系统 WKWebView LTR/RTL 几何 16 项通过,最大偏差 0.235 CSS px;Playwright WebKit 横向/纵向 LTR/RTL 拖动和轨道点击 8 项通过。实际 Chromium headless 的相同 8 项输入测试也全部通过,并确认所有场景仍使用原生 ScrollTimeline、没有 WebKit fallback class。
  • 最终全量 Vitest:764 个测试文件、11,366 项全部通过(vitest run --maxWorkers=2 --testTimeout=15000)。首次默认 5 秒超时下有一条 activity-rows 大量 DOM 渲染测试超时,最终轮次仅提高运行超时预算,未修改测试或产品代码。

原生实验是针对这个分配路径的短时对照,不能证明 Codeg 所有长期内存增长都已消失。补丁升级与复测说明见 patches/README.md。

Refs #1097

The frontend stage ran pnpm install with only the manifest and lockfile,
so patchedDependencies failed to read patches/overlayscrollbars@2.15.1.patch.
Also bound the OverlayScrollbars entrypoint test's child processes and give
the suite an explicit timeout so a loaded parallel run does not flake.
…ith spacering-net#1114)

Keep both patchedDependencies entries (@tauri-apps/api and overlayscrollbars)
in pnpm-workspace.yaml and the lockfile, combine both patch notes in
patches/README.md, and take main's Dockerfile, which already copies
patches/ before install.
@xintaofei

Copy link
Copy Markdown
Collaborator

codeg work task 495 is done — #1115 (13 files, +651/-74).

@xintaofei
xintaofei merged commit 85c25b0 into spacering-net:main Nov 10, 2026
0 of 10 checks passed
xintaofei added a commit that referenced this pull request Nov 11, 2026
This release reduces memory growth during extended use, fixes missing collaboration tools in forked Codex conversations, restores skill selection for custom agents, and updates several agents.

## Improved

- **Claude Code is updated to 2.1.322 with adapter 0.106.0.**
- **Updated OpenCode to 2.2.7, Kimi Code to 2.5.3, Hermes Agent to 0.23.1 and the ZCode bridge to 0.83.3.**

## Fixed

- **Reduced memory buildup during repeated scrolling, view changes and streaming code generation**, improving memory usage during extended sessions. (#1114, #1115, #1117 by @kogekiplay)
- **Custom agents with a configured skill directory or shared skill store now list their skills in the `/` menu**, in both chat and automation editors. (#1121 by @ana52070)
- **Forked Codex conversations retain their enabled MCP tools**, allowing you to continue delegating work to sub-agents and retrieving their results. (#1105)
- **Reopening a conversation no longer adds duplicate context compaction cards after the existing history.**
- **OpenCode commands that time out or are terminated no longer incorrectly appear as successful.**
- **OpenCode file previews correctly display reads beyond the end of a file**, while reads counted from the end no longer show a misleading line range.
- **Reopening older ZCode conversations correctly restores their saved titles.**

Thanks to @kogekiplay (#1114, #1115, #1117) and @ana52070 (#1121) for their contributions, and to @lxpsxx (#1105) for the report.

-----------------------------

# 发布版本 0.42.3

这一版改善长时间使用时的内存占用,修复 Codex 分叉会话后协作工具丢失、自定义智能体无法选择技能等问题,并更新多个智能体。

## 改进

- **Claude Code 更新至 2.1.322,适配器更新至 0.106.0。**
- **OpenCode 更新至 2.2.7,Kimi Code 更新至 2.5.3,Hermes Agent 更新至 0.23.1,ZCode 桥接更新至 0.83.3。**

## 修复

- **减少反复滚动、切换视图和持续生成代码时的内存累积**,改善长时间使用时的内存占用。(#1114、#1115、#1117 by @kogekiplay)
- **配置了技能目录或共享技能库的自定义智能体,可以在 `/` 菜单中选择技能**,聊天输入框和自动化编辑器均可使用。(#1121 by @ana52070)
- **Codex 分叉会话后会保留已启用的 MCP 工具**,可以继续委派子智能体并获取执行结果。(#1105)
- **重新打开会话时,已有的上下文压缩卡片不会再重复出现在历史记录末尾。**
- **OpenCode 中超时或被终止的命令,不再被误标为执行成功。**
- **OpenCode 读取位置超出文件末尾时,返回内容仍能正确预览**,从文件末尾倒数读取时也不会再显示错误的行号范围。
- **重新打开较早的 ZCode 会话时,能正确恢复已保存的会话标题。**

感谢 @kogekiplay(#1114、#1115、#1117)和 @ana52070(#1121)的贡献,以及 @lxpsxx(#1105)的反馈。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants