Skip to content

Electron 渲染过程变得无响应,并在 window.log 中记录“渲染器无响应”。冻结持续~3秒;应用恢复了,但性能严重下降。 #40572

Closed as not planned

Description

@FOURTEEN1416

Description

Desktop v1.18.13 — Renderer freezes (unresponsive) due to Solid.js computeTransform/computeStyle reactive dependency cycle, amplified by ResizeObserver thrashing + API rate-limit retry storms

The Electron renderer process becomes unresponsive and logs "renderer unresponsive" in window.log. The freeze lasts ~3 seconds; the app recovers but is severely degraded.

Plugins

No third-party plugins. Using MCP servers: github, memory, postgres (local), playwright, scheduler.

OpenCode version

v1.18.13 (packaged)

Steps to reproduce

Steps to reproduce
Use OpenCode Desktop v1.18.13 on Windows 11
Have multiple projects open (at least one session active)
Use a model provider that hits rate limits (e.g., sensenova with TPM/rpm limits)
Have multiple concurrent LLM streams active
Add a new project directory to the workspace while a session is active
After ~30 seconds of API retry storms, the renderer freezes for 3-5 seconds then recovers

Screenshot and/or share link

Not available at this time. Debug logs exported at the time of freeze are available.

Operating System

Windows 11 (build 10.0.26200)

Terminal

N/A (OpenCode Desktop app)

Activity

  1. github-actions commented on Aug 5, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    These existing issues cover the same symptoms (renderer freeze, ResizeObserver thrashing, Solid.js reactive loops in the Desktop app). If your issue is distinct, please clarify what differentiates it from those reports.

  2. FOURTEEN1416 commented on Aug 5, 2026

    @FOURTEEN1416
    Author

    详细日志分析(来自 debug 日志包 opencode-debug-20260804T173459.zip)

    这是 v1.18.13 在 Windows 11 上的冻结事件日志分析。不是普通的 ResizeObserver 卡顿——有新的证据链。


    完整时间线(北京时间 UTC+8)

    时间 事件 证据文件
    01:27:35 OpenCode Desktop v1.18.13 启动,sidecar 127.0.0.1:52076 main.log
    01:27:40 ResizeObserver loop 错误开始(零星) renderer.log
    01:32:35-51 最后一次 agent 运行(run c618cfc4,16步),多次 rpm exhausted 流式错误被重试吞掉 opencode.log
    01:32:57-33:02 ResizeObserver 错误爆炸:5秒内 25+ 条 renderer.log
    01:33:04 服务端正常 exiting loop,会话结束 opencode.log
    01:34:31 最后一条 ResizeObserver 错误 renderer.log
    01:34:51 渲染进程无响应 window.log
    01:34:54 渲染进程恢复(约3秒) window.log
    01:34:59 用户导出 debug 日志 main.log

    关键证据 1:stack trace 精确卡死位置

    window.log 在冻结时捕获的调用栈样本:

    at computeTransform (main-5RU9uMOP.js:141619:28)
    at computeStyle (main-5RU9uMOP.js:141615:18)
      at runComputation (main-5RU9uMOP.js:487:22)
      at updateComputation (main-5RU9uMOP.js:470:3)
      at runTop (main-5RU9uMOP.js:566:7)
      at runUserEffects (main-5RU9uMOP.js:660:39)
      at completeUpdates (main-5RU9uMOP.js:634:18)
      at runUpdates (main-5RU9uMOP.js:584:5)
      at batch (main-5RU9uMOP.js:265:10)
      at setStore (main-5RU9uMOP.js:34534:5)
    

    结论: setStore 触发了 SolidJS 的批量响应式更新,computeTransform->computeStyle 的依赖图太大,单次同步批处理占满主线程 3 秒。


    关键证据 2:rpm exhausted 作为放大器

    服务端日志显示在冻结前 2 分钟,sensenova/deepseek-v4-flash 连续触发 rpm exhausted 错误:

    17:32:35.295 ERROR stream error: "AI_APICallError: rpm exhausted"
    17:32:37.304 自动重试成功
    17:32:45.761 ERROR stream error: "AI_APICallError: rpm exhausted"
    17:32:47.856 ERROR stream error: "AI_APICallError: rpm exhausted"
    17:32:51.857 最终重试成功
    

    每次重试意味着新的流式 token 被推入 store,每次 setStore 触发一次响应式 cascade。API 限流错误 -> 重试 -> 更多 store 写入 -> 更大的响应式依赖图 -> 更长的冻结时间。


    关键证据 3:布局抖动(layout thrash)的量化数据

    renderer.log 中 ResizeObserver loop completed with undelivered notifications 的数量:

    • 本次会话(172735):67 条,其中 5 秒内爆发 25+ 条
    • 历史会话(125031):约 20 条
    • 更早会话(101628):约 12 条

    这是反复出现的慢性问题,每次会话都有,但严重程度在累积。


    关键证据 4:异常大的 network.netlog(8.4 MB)

    7 分钟会话产生 8.4 MB 网络日志,说明大量 IPC 流量涌入 UI(主要是流式 token + 工具结果逐 chunk 推入 store)。每次推送触发响应式更新,开销放大。


    为什么这不是完全重复(与现有 issue 的区别)

    现有 issue 缺失的证据 本 issue 新增
    #38296 只有 ResizeObserver 症状,无 stack trace 精确的 computeTransform->computeStyle->setStore 调用链
    #37997 旧布局 UI 冻结,无 API 层关联 证明了 rpm exhausted 重试风暴与冻结的因果关系
    #33712 没有量化布局抖动频率 67 条 ResizeObserver 错误,爆发密度 5 秒 25+ 条
    #31099 findDOMIndex 无限循环 不同路径——computeStyle 依赖图太大而非 DOM 索引循环

    本 issue 核心贡献: 首次用 stack trace 证据链证明 setStore->SolidJS 响应式重算->computeStyle 是冻结的直接原因,并量化了 rpm exhausted 重试风暴作为放大器。


    建议修复路径

    1. [高优先级] store 写入节流:流式 token 入 store 时做 requestAnimationFrame 合并 + 阈值控制,避免逐 chunk 同步写入。这是最直接的缓解。
    2. [高优先级] ResizeObserver 防抖:给虚拟列表的尺寸观测加 rAF 延迟 + size-delta 阈值,消除布局抖动死循环。
    3. [中优先级] 会话消息懒渲染:16 步 + 大工具输出的会话消息树很大,考虑对历史消息做卸载或虚拟化。
    4. [低优先级] computeStyle bailout:当 diff 为空时跳过全量重算。
    5. [低优先级] API 重试风暴保护:rpm exhausted 重试时增加指数退避 + store 写入合并,减少重试对 UI 的冲击。

    相关 issue

  3. LYXverynb commented on Aug 11, 2026

    @LYXverynb

    [Bug] 渲染进程卡死 + ResizeObserver loop + 间歇性崩溃(Windows)

    版本:opencode desktop 1.18.15(崩溃)→ 1.18.16(卡死仍在,仅崩溃类型变化)
    平台:Windows(win32),Electron 42.3.3
    复现概率:每次启动后 1~60 秒内必然出现 renderer unresponsive;高频使用时会 OOM/崩溃

    问题现象

    1. 每次启动后,界面随机卡死(renderer unresponsive),持续几秒到几分钟后恢复,或直接崩溃。
    2. renderer.log 反复出现 ResizeObserver loop completed with undelivered notifications.
    3. 1.18.15 时代:render process gone { reason: 'oom', exitCode: -536870904 }(内存耗尽崩溃,多次)。
    4. 升级 1.18.16 后:OOM 消失,但仍 renderer unresponsive,且出现 render process gone { reason: 'crashed', exitCode: -1 }。

    日志证据

    renderer.log(1.18.16)

    [2026-08-11 15:14:33.885] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-08-11 15:14:34.414] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-08-11 15:08:45.458] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-08-11 15:10:41.853] [error] ResizeObserver loop completed with undelivered notifications.
    [2026-08-11 15:10:41.884] [error] ResizeObserver loop completed with undelivered notifications.
    

    window.log(1.18.15,OOM 崩溃)

    [2026-08-10 16:02:16.324] [error] renderer unresponsive
    [2026-08-10 16:04:20.068] [error] app render process gone { reason: 'oom', exitCode: -536870904 }
    [2026-08-10 16:04:20.070] [error] renderer process gone { reason: 'oom', exitCode: -536870904 }
    
    [2026-08-11 12:57:12.269] [error] renderer unresponsive
    [2026-08-11 12:59:21.536] [error] app render process gone { reason: 'oom', exitCode: -536870904 }
    

    window.log(1.18.16,崩溃类型变化)

    [2026-08-11 15:15:05.821] [error] renderer unresponsive
    [2026-08-11 15:11:00.409] [error] app render process gone { reason: 'crashed', exitCode: -1 }
    

    补充信息

    期望

    1. 修复 ResizeObserver loop 导致的渲染进程卡死(layout thrashing)。
    2. 提供禁用某些 UI 渲染特性的临时 workaround(如设置项开关)。
  4. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions