Extension webview can freeze workbench under large Vite modulepreload burst
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- react, typescript, vite
- Área
- frontend, performance, web-dev
Línea de trabajo
Empieza siguiendo la ruta del recurso de webview a través de readFileStream y loadResource; después inspecciona RequestStore#acceptReply mientras reproduces el gran burst de preload de la entrada de webview de Codex informada y de webview/index.html. Se considera terminado cuando una webview grande de una extensión ya no congela el workbench de escritorio ni produce señales de fugas de listeners y solicitudes no coincidentes, pero el issue no proporciona un reproducer independiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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:
- https://github.com/openai/codex/issues/28726
- final Codex-side follow-up: https://github.com/openai/codex/issues/28726#issuecomment-4762217105
The 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.
Environment
- Server OS: Arch Linux
- code-server: 4.123.0 / VS Code base 1.123.0 at the time of local testing
- Extension involved:
[email protected], linux-x64 - Affected clients:
- Windows Edge / Chromium-based browsers
- Arch Linux Chromium / Chrome-family browsers
- Less affected client:
- Android Samsung Internet against the same code-server instance
Symptom
Opening 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.
Removing the extension avoided the freeze.
Relevant browser console / server log signals
Browser DevTools showed the freeze path going through workbench webview/resource loading:
potential listener LEAK detected
doReadFileStream
readFileStream
loadResource
The code-server server log also repeatedly showed:
RequestStore#acceptReply was called without receiving a matching request
These messages appeared at the time the sidebar webview was opened.
Local diagnosis
The generated Codex webview entry file contained a large Vite dependency preload list:
~/.local/share/code-server/extensions/openai.chatgpt-26.609.30741-linux-x64/webview/assets/index-CaOlcDW2.js
The relevant pattern was:
await e(() => import("./app-main-FqROzk9D.js"), __vite__mapDeps([0, 1, 2, ... 486]), import.meta.url)
That meant the extension webview attempted to preload hundreds of local JS/CSS assets as soon as the sidebar webview was mounted.
In 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.
Workaround that fixed the freeze locally
I patched the generated extension webview entry so that only CSS chunks were preloaded, while the hundreds of JS chunks were no longer eagerly preloaded:
__vite__mapDeps([48,94,136,137,166,189,202,210,232,264,315,320,329,384,387,421,469,484,485,486])
I also removed four static modulepreload links from the extension's webview/index.html.
Results:
- Desktop Chromium / Edge no longer froze when opening the webview.
- Android Samsung Internet still rendered the UI correctly.
- Removing the preload list entirely avoided the desktop freeze but broke the UI on Android because CSS chunks were not loaded early enough.
- Keeping only CSS preloads preserved rendering while avoiding the desktop freeze.
Why this may matter for code-server
This was triggered by the Codex extension, but the hard-freeze failure mode seems broader:
- A large extension webview can issue a burst of hundreds of local asset requests.
- code-server's webview resource bridge appears able to enter a listener leak / request mismatch / freeze state under that burst.
- Other large Vite/React extension webviews could potentially hit the same path.
Possible code-server-side mitigations might include:
- throttling or batching webview local-resource requests,
- improving listener cleanup around
readFileStream/loadResource, - making
RequestStore#acceptReplymismatches fail gracefully, - avoiding full workbench freezes when an extension webview preloads too many local resources at once.
Closing note
I 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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 79.9k
- Forks
- 6.9k
- Merge medio
- 20 h 21 min
- PR fusionados (30 d)
- 51
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de coder/code-server
-
Error not trueAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
coder/code-server#8148 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 51/100
coder/code-server#8145 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
coder/code-server#8142 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: --proxy-domain does not proxy when the host includes a portPosiblemente ocupada @adityajai119 la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
coder/code-server#8128 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: /healthz with a query string triggers a heartbeatPosiblemente ocupada @adityajai119 la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
coder/code-server#8126 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de coder/code-server
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
security: set top-level least-privilege permissions in five workflowsPosiblemente ocupada @JonathanTSilva la tomó hoy. Abiertopriority: p2 size: xs type: security
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
JonathanTSilva/jts-website#150 ·
Los mantenedores suelen responder en 1 día
-
[BUG] SETUP.md is out of dateAbiertobug Needs Triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
scottbenton/Iron-Link#437 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
speakeasy-api/speakeasy#2159 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel-labs/ui#1066 ·
Los mantenedores suelen responder en 1 día