ntermittent dead renderer-to-extension-host RPC on load: restored workbench state (browser storage) races the web-worker exthost handshake; incognito always healthy
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
The payload names no source files; the suspected boot ordering between the web-worker extension host handshake and restored session state is a hypothesis, not a located fault. Start by reproducing with a state-rich browser profile and comparing console and server exthost logs for eager=0 versus eager=1. Read the related #4212, #7914 and #7384 threads before proposing a change. Done would mean a reproducible ordering fix or a detectable handshake failure, which needs maintainer design input first.
由索引模型根据 Issue 内容生成。
描述
Is there an existing issue for this?
- I have searched the existing issues
OS/Web Information
- Web Browser: Microsoft Edge (Chromium) on Windows 11 x64
- Local OS: Windows 11 x64
- Remote OS: Linux (cloud VM)
- Remote Architecture: x86_64
- code-server --version: 4.140.0
Steps to Reproduce
- Use a long-lived normal browser profile that has accumulated site data for the code-server origin (approx 4 MB IndexedDB, actively rewritten during use).
- Open or reload http://HOST:10029/?folder=WORKSPACE.
- Wait 30-45 s for the workbench to boot.
- Broken load: explorer tree and previously open editors are restored, but opening any file fails with "Cannot open editor because the file cannot be found"; no extension activates (clangd stops at creating its output channel).
- Reload: the next load rolls again and may be healthy; a healthy load then stays healthy.
- Open the same URL in incognito (no stored site data): first load is healthy and stays healthy.
- Server-side during a broken load: exthost process alive and streaming, eager=0; during a healthy load eager=1. Same server, same minute.
Expected
Every page load establishes a working renderer-to-extension-host RPC channel: restored editors open their files and all extensions activate, regardless of how much session state the browser profile holds.
Actual
On most loads in a state-rich profile the renderer never answers exthost-initiated RPC for the whole session: extensions hang at activation step 1 and restored editors fail with file-not-found, while the explorer tree (restored from cache) is populated. Loads in incognito/fresh profiles are consistently healthy. Per-load outcome is independent (a race), not persistent corruption.
Logs
Browser console (broken load):
[WARNING] The web worker extension host is started in a same-origin iframe!
[INFO] Creating a socket (renderer-ExtensionHost-...) was successful after 190 ms.
[INFO] [AgentHost:remote] Connected; clientId=...
[INFO] [RemoteAgentHost] Reconciling: desired=[], current=[]
[ERROR] (empty message) x3
Server side: exthost alive, bidirectional traffic flowing, renderer never replies;
eager=0 (broken) vs eager=1 (healthy).
Statistics, normal profile, single client: 5 loads -> 4 broken
(20:22, 20:25:27, 20:33, 20:42) / 1 healthy (20:25:13);
historical single-connection sessions 31 broken vs 13 healthy;
incognito first load healthy.
Client storage: origin IndexedDB approx 4 MB, log file rewritten during use;
clearing site data produced a healthy run.
Screenshot/Video
No response
Does this bug reproduce in native VS Code?
I did not test native VS Code
Does this bug reproduce in VS Code web?
I did not test VS Code web
Does this bug reproduce in GitHub Codespaces?
I did not test GitHub Codespaces
Are you accessing code-server over a secure context?
- I am using a secure context.
Notes
Hypothesis: at boot the workbench (a) wires the message channel to the web-worker extension host (same-origin iframe) and (b) replays restored session state from browser storage; these are not ordered. With a thick restore payload the restore path issues exthost-dependent requests before the renderer reply path is ready and the handshake/reply wiring is lost for that load; the exthost keeps sending RPC nobody answers (eager=0). Without restore state (incognito, fresh profile, after Clear site data) boot does essentially only the handshake and wins consistently.
Workarounds that change the odds: clear site data for the origin (after saving files); close all editors (Ctrl+K W) before closing/reloading; dedicated lightweight browser profile; wait 30-45 s before judging a reload (fast reloads kill healthy exthosts, observed a host killed at ~11 s).
Related: #4212 and #7914 (workbench state in browser storage; v4.141.0 adds opt-in --enable-remote-storage). Question: does enabling it remove this trigger, and does it cover extension-owned browser storage (language-server caches, dirty-file backups) as well? Also #7384 (restore triggers unexpected reloads, closed not_planned) and #7391 / #3140 (extensions unusable / unable to activate) look like downstream symptoms.
Requested: order/queue restore-path requests until the reply channel is ready (or retry), and make handshake failure detectable and self-healing instead of a silently dead channel.
Caveat: not tested in native VS Code, vscode web or Codespaces; the three dropdowns are set to "No" meaning observed only in code-server.
Happy to provide paired healthy/broken client console logs and server exthost logs with eager values and timelines.
- 主要语言
- TypeScript
- 星标
- 79.9k
- 派生
- 6.9k
- 平均合并
- 20 小时 21 分钟
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/code-server 的其他 Issue
-
Error not true未关闭
难度 3/5 1-2 天 新手友好度 45/100
coder/code-server#8148 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 51/100
coder/code-server#8145 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 15/100
coder/code-server#8142 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: --proxy-domain does not proxy when the host includes a port可能已有人在做 @adityajai119 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 35/100
coder/code-server#8128 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug]: /healthz with a query string triggers a heartbeat可能已有人在做 @adityajai119 于 10 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 25/100
coder/code-server#8126 · 1 条评论 ·
维护者通常 1 天内回复
查看 coder/code-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
vercel-labs/ui#1066 ·
维护者通常 1 天内回复
-
fix(factory-cockpit): display active agent/actor name instead of verbose step name in run card badge未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
ranxianglei/billion-context#7597 ·
维护者通常 1 天内回复
-
documentation target:powerpoint
难度 1/5 1 小时以内 新手友好度 76/100
tomast1337/PdfLapas#602 ·
维护者通常 1 天内回复
-
kubernetes-ingestor: fetchCRDMapping() runs even when crossplane.enabled is false, logging a 403 ERROR every run可能已有人在做 @kc9ddi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
TeraSky-OSS/backstage-plugins#228 ·