Title: Extension webview can freeze workbench under large Vite modulepreload burst · Issue #7867 · coder/code-server · GitHub
Open Graph Title: Extension webview can freeze workbench under large Vite modulepreload burst · Issue #7867 · coder/code-server
X Title: Extension webview can freeze workbench under large Vite modulepreload burst · Issue #7867 · coder/code-server
Description: Summary An extension webview that eagerly preloads hundreds of local Vite chunks can freeze the code-server workbench on desktop Chromium-based browsers. I originally investigated this as an OpenAI Codex extension issue: openai/codex#287...
Open Graph Description: Summary An extension webview that eagerly preloads hundreds of local Vite chunks can freeze the code-server workbench on desktop Chromium-based browsers. I originally investigated this as an OpenAI...
X Description: Summary An extension webview that eagerly preloads hundreds of local Vite chunks can freeze the code-server workbench on desktop Chromium-based browsers. I originally investigated this as an OpenAI...
Opengraph URL: https://github.com/coder/code-server/issues/7867
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Extension webview can freeze workbench under large Vite modulepreload burst","articleBody":"## Summary\n\nAn extension webview that eagerly preloads hundreds of local Vite chunks can freeze the code-server workbench on desktop Chromium-based browsers.\n\nI originally investigated this as an OpenAI Codex extension issue:\n\n- https://github.com/openai/codex/issues/28726\n- final Codex-side follow-up: https://github.com/openai/codex/issues/28726#issuecomment-4762217105\n\nThe local workaround was applied inside the Codex extension bundle, but the failure path appears to involve code-server's webview resource loading bridge as well. I am filing this here as a closed informational issue because the same class of problem may affect other large extension webviews.\n\n## Environment\n\n- Server OS: Arch Linux\n- code-server: 4.123.0 / VS Code base 1.123.0 at the time of local testing\n- Extension involved: `openai.chatgpt@26.609.30741`, linux-x64\n- Affected clients:\n - Windows Edge / Chromium-based browsers\n - Arch Linux Chromium / Chrome-family browsers\n- Less affected client:\n - Android Samsung Internet against the same code-server instance\n\n## Symptom\n\nOpening the Codex sidebar in code-server caused the browser/workbench UI to freeze shortly after the webview iframe was mounted, before opening any specific thread.\n\nRemoving the extension avoided the freeze.\n\n## Relevant browser console / server log signals\n\nBrowser DevTools showed the freeze path going through workbench webview/resource loading:\n\n```text\npotential listener LEAK detected\ndoReadFileStream\nreadFileStream\nloadResource\n```\n\nThe code-server server log also repeatedly showed:\n\n```text\nRequestStore#acceptReply was called without receiving a matching request\n```\n\nThese messages appeared at the time the sidebar webview was opened.\n\n## Local diagnosis\n\nThe generated Codex webview entry file contained a large Vite dependency preload list:\n\n```text\n~/.local/share/code-server/extensions/openai.chatgpt-26.609.30741-linux-x64/webview/assets/index-CaOlcDW2.js\n```\n\nThe relevant pattern was:\n\n```js\nawait e(() => import(\"./app-main-FqROzk9D.js\"), __vite__mapDeps([0, 1, 2, ... 486]), import.meta.url)\n```\n\nThat meant the extension webview attempted to preload hundreds of local JS/CSS assets as soon as the sidebar webview was mounted.\n\nIn code-server, those local webview asset requests flow through the browser/workbench resource bridge and extension file loading path. On desktop Chromium clients, this appeared to trigger the `readFileStream` / `loadResource` listener leak and `RequestStore#acceptReply` mismatch, then the workbench froze.\n\n## Workaround that fixed the freeze locally\n\nI patched the generated extension webview entry so that only CSS chunks were preloaded, while the hundreds of JS chunks were no longer eagerly preloaded:\n\n```js\n__vite__mapDeps([48,94,136,137,166,189,202,210,232,264,315,320,329,384,387,421,469,484,485,486])\n```\n\nI also removed four static `modulepreload` links from the extension's `webview/index.html`.\n\nResults:\n\n- Desktop Chromium / Edge no longer froze when opening the webview.\n- Android Samsung Internet still rendered the UI correctly.\n- Removing the preload list entirely avoided the desktop freeze but broke the UI on Android because CSS chunks were not loaded early enough.\n- Keeping only CSS preloads preserved rendering while avoiding the desktop freeze.\n\n## Why this may matter for code-server\n\nThis was triggered by the Codex extension, but the hard-freeze failure mode seems broader:\n\n- A large extension webview can issue a burst of hundreds of local asset requests.\n- code-server's webview resource bridge appears able to enter a listener leak / request mismatch / freeze state under that burst.\n- Other large Vite/React extension webviews could potentially hit the same path.\n\nPossible code-server-side mitigations might include:\n\n- throttling or batching webview local-resource requests,\n- improving listener cleanup around `readFileStream` / `loadResource`,\n- making `RequestStore#acceptReply` mismatches fail gracefully,\n- avoiding full workbench freezes when an extension webview preloads too many local resources at once.\n\n## Closing note\n\nI am closing this issue myself because I have a local workaround and cannot provide a minimal standalone reproducer right now. I am leaving the report in case it helps future investigation of code-server's webview resource bridge under large modulepreload bursts.\n","author":{"url":"https://github.com/SMOKE-19","@type":"Person","name":"SMOKE-19"},"datePublished":"2026-06-21T14:34:50Z","url":"https://github.com/coder/code-server/issues/7867"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ac7a790b-fe40-705d-3002-662cd66cd3e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CC00:313BCB:E8F3D:142053:6B042F01 |
| html-safe-nonce | 0acac44818b306b5aa0d515f2a386d5db6493542695c12d2a1aaed66ec4ee9d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzAwOjMxM0JDQjpFOEYzRDoxNDIwNTM6NkIwNDJGMDEiLCJ2aXNpdG9yX2lkIjoiNTQ4MTkxMzI5NzA5Nzk5Mzk4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f54af171e3546815f83eb22e846d2fa43a5f1ed4f971758e7650ccd2f58be67c |
| hovercard-subject-tag | issue:4710831100 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/code-server/7867/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6fd0406fd968526a6264c30dfeb95b618452c1dbcc5121c3c6d2723c6d87c621/coder/code-server/issues/7867 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6fd0406fd968526a6264c30dfeb95b618452c1dbcc5121c3c6d2723c6d87c621/coder/code-server/issues/7867 |
| og:image:alt | Summary An extension webview that eagerly preloads hundreds of local Vite chunks can freeze the code-server workbench on desktop Chromium-based browsers. I originally investigated this as an OpenAI... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | SMOKE-19 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/code-server git https://github.com/coder/code-server.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 172953845 |
| octolytics-dimension-repository_nwo | coder/code-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 172953845 |
| octolytics-dimension-repository_network_root_nwo | coder/code-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width