VS Code extension: Codex panel hangs at logo forever in every window after the first — webview module-preload storm trips Chromium service-worker fetch limit ("insufficient resources")

Open
#34,103 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
vite, vscode

Research direction

Start with the webview/assets/preload-helper-*.js bundle and inspect how Vite's preload helper injects modulepreload links. Reproduce the issue by opening Codex in a second VS Code window and use Webview Developer Tools to observe failed resource requests. Done means secondary windows mount their routes without the insufficient-resources errors and the logo-only splash.

Written by the indexing model from the issue text.

Description

bug extension performance

Environment

  • Codex IDE extension: 26.715.31925 (linux-x64); behavior reproduced across multiple earlier versions (26.707.x line as well) — long-standing, not a fresh regression
  • VS Code: 1.129.1 (commit 8a7abeba6e03ea3af87bfbce9a1b7e48fed567b8), rpm install
  • OS: Fedora 43, kernel 7.1.3, KDE Plasma on Wayland, Nvidia 580.173.02
  • Note: "disable-hardware-acceleration": true in argv.json (does not affect the outcome; issue reproduced with and without)

Summary

With one VS Code window open, Codex works. In any second window of the same VS Code process (File → New Window, with or without a folder), the Codex panel shows the logo splash forever. No error is surfaced anywhere — extension log simply stops after Initialize received; the webview milestones (React root render requested / Features enabled / routes mounted) never occur. Backend (codex app-server) is healthy: it spawns, answers initialize, and IPC broadcasts from the first window's router are delivered to the second window.

Root cause (diagnosed via webview DevTools)

The webview bundle is code-split into hundreds of small chunks, and the Vite preload-helper injects <link rel="modulepreload"> for the entire dependency graph before importing app-main. In a secondary window, the host's resource reads back up (VS Code-side loadResourcedoReadFileStream; listener count observed climbing 175 → 263 → 441 → 614+), until Chromium's cap on concurrent service-worker FetchEvents trips:

The FetchEvent for "<URL>" resulted in a network error response: insufficient resources.   (×50+)

After the cap trips, every subsequent resource request fails:

file+.vscode-resource.vscode-cdn.net/.../webview/assets/<chunk>.js  Failed to load resource: net::ERR_FAILED   (hundreds)
Uncaught Error: Unable to preload CSS for .../composer-approval-request-card-*.css  (preload-helper)
Uncaught TypeError: Failed to fetch dynamically imported module: .../app-main-BPH9pd0X.js

→ the app never boots; the static splash (logo) is all the user ever sees.

First windows usually win this race (reads complete before the cap); secondary windows of the same process reliably lose it. Markdown preview and other small webviews work fine in the same broken window — only resource-heavy webviews are affected.

Reproduction

  1. Open VS Code with the Codex extension; let Codex load in window 1.
  2. File → New Window (same process; folder or no folder — irrelevant).
  3. Open the Codex panel in window 2 → eternal logo.
  4. Developer: Open Webview Developer Tools on the panel → console shows the errors above.

Verified fix (local patch, works immediately)

Editing webview/assets/preload-helper-*.js to skip non-CSS preload link injection (keeping the required CSS handling) fixes secondary windows completely — modules then load on demand in bounded waves. One-line change: after the helper's .css detection, early-return for JS deps. Verified: pre-patch, 6/6 secondary windows hung with the errors above; post-patch, secondary windows mount routes in ~1.5 s with zero failed requests.

Suggested fixes upstream

  • Limit preload concurrency (batch the modulepreload injection, e.g. ≤64 in flight), or drop JS modulepreload hints entirely in the webview build, or reduce chunk count (fewer/larger chunks) for the VS Code webview target.
  • Independently: surface fatal webview boot failures to the user instead of an indefinite splash — a "failed to load, retry" state would have made this diagnosable years earlier. A related silent-hang complaint applies to other startup failures too (e.g. auth in a bad state produces the same eternal logo with no re-auth prompt).

Also relevant to VS Code

A companion report is filed as microsoft/vscode#326500 (https://github.com/microsoft/vscode/issues/326500) covering the host-side behavior (resource reads stalling under concurrent webview fetch load in multi-window sessions, with potential listener LEAK warnings in doReadFileStream/loadResource). Either side can fix this class: fewer concurrent requests from the extension, or non-collapsing resource serving in VS Code.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.