Windows: adding a second root folder to a project crashes the app UI ("process is not defined")
What version of the Codex App are you using (From “About Codex” dialog)?
26.721.31836 (package OpenAI.Codex_26.721.3996.0_x64, app-server 0.146.0-alpha.3.1)
What subscription do you have?
ChatGPT Pro (personal)
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
On Windows, as soon as a project has more than one root folder, the renderer crashes and the app becomes unusable: instead of the UI you get the "Oops, an error occurred" screen with "Update ChatGPT" / "Try again". "Try again" re-crashes ~250 ms after app routes mounted, on every launch, so there is no way to reach project settings and remove the extra folder from inside the app.
The first crash in my case happened 19 seconds after I added two extra folders to a project (project updatedAt in .codex-global-state.json = 2026-08-12T11:44:22.504Z, first error boundary at 11:44:41Z).
Log (%LOCALAPPDATA%\Packages\OpenAI.Codex_*\LocalCache\Local\Codex\Logs\<Y>\<M>\<D>\codex-desktop-*-t0-*.log):
error [electron-message-handler] error boundary componentStack="
at C3s (app://-/assets/app-initial-DVfVy4b5.js:8875:151178)
at gk (app://-/assets/app-initial-DVfVy4b5.js:915:7110)
..."
errorMessage="process is not defined" errorName=Error name=AppRoutes
The backend side is healthy — app-server handshake ok, auth ok, GET /backend-api/codex/models -> 200 OK. This is purely a renderer crash.
Root cause
C3s in app-initial-DVfVy4b5.js is the thread-file-search command-menu registration. It de-duplicates workspace roots with:
function TFi(e){ return e.filter((t,n)=>e.every((e,r)=>{
if (r===n) return true; // never compares when there is only 1 root
let i = path.posix.relative(bf(e), bf(t)); // <-- browserify path shim
return i===".." || i.startsWith("../") || (i==="" && r>n)
}))}
The bundled path is the browserify shim, whose resolve() falls back to process.cwd() when no argument starts with /. A Windows path (D:\Repos\foo) is never absolute under the POSIX shim, so that branch is always taken — and process does not exist in the sandboxed renderer, hence ReferenceError: process is not defined.
With a single root the inner every callback only ever hits r === n and returns early, so relative() is never called. That is why this breaks only at 2+ roots, and why the app worked fine for weeks before.
What steps can reproduce the bug?
On Windows:
- Open a project with a single root folder — the app works normally.
- Add a second folder to the same project (so
local-projects.<id>.rootPathsin~/.codex/.codex-global-state.jsonhas 2+ entries). - The UI crashes with the "Oops, an error occurred" screen, and keeps crashing on every relaunch — the selection is persisted, so the app never recovers on its own.
Reproduces regardless of which folders are used, as long as there are two or more Windows paths.
What is the expected behavior?
A project with multiple root folders works on Windows the same way it does on macOS/Linux: the @-mention file search de-duplicates nested roots and the UI keeps rendering.
Additionally, an error thrown while registering a command-menu entry should not take down the whole AppRoutes subtree — right now one throwing hook makes the entire app unreachable, with no way to undo the setting that caused it.
Additional information
Suggested fix: use the platform-aware path (path.win32 on Windows) for that comparison, or compare normalized absolute paths without routing them through the POSIX shim's resolve(). Bundling a path shim that reaches for process.cwd() in a sandboxed renderer is a latent crash for every Windows code path that calls resolve()/relative() with a drive-letter path — this is just the first place it surfaced.
Workaround (for anyone hitting this): quit all ChatGPT.exe, then in ~/.codex/.codex-global-state.json reduce local-projects.<id>.rootPaths back to a single path — mirror the same edit into the .bak file next to it, since the app reads it too — and relaunch. Threads, config.toml and auth are unaffected.
Notes:
windows-store-updaterreportshasUpdate=false overallState=NoUpdates, so the "Update ChatGPT" button on the error screen has nothing to fetch and does not help.- Only the primary window crashes; the avatar-overlay window (webContentsId 2) renders fine.
- Paths in this report are genericized.
1 Comment
Another affected Windows user here. This bug blocks a practical multi-folder workflow for a long-term thesis project: keeping the LaTeX writing workspace as the primary root while adding a separate literature folder for reference access. Because adding a second root can make the app unrecoverably crash on relaunch, I currently have to avoid the feature entirely and consider awkward file-mirroring workarounds instead.
The issue is still open and currently has no comments/status update. A fix or even a short status/ETA would be very helpful, especially since multi-folder projects are otherwise exactly the right workflow for this use case. Thanks.