Aident AI

Fix Codex Windows "Oops" After Adding a Second Folder
If Codex Desktop on Windows became stuck on "Oops, an error has occurred" immediately after you added a second folder, fully quit the app and update it first. If the error survives the update, back up both Codex global-state files and remove only the newly added path from the affected project's rootPaths array in each copy. Keep the original root, validate both JSON files, and reopen Codex.
Do not delete the entire .codex directory. Multiple July 24-27, 2026 reports show that the smaller edit can restore the app while preserving chats, authentication, projects, and unrelated settings. OpenAI has not published a universal recovery procedure, and reports about build 26.721.41059 conflict, so treat this as a careful workaround for the exact multi-folder failure.
Prerequisites
Before changing local state:
confirm the failure began when a second folder was added to one Codex project;
record the app version from Settings > About if the UI still opens;
close active Codex tasks and save unrelated work;
use Windows PowerShell under your normal account;
keep both backup files until Codex has launched successfully more than once.
This guide applies to Codex or ChatGPT Desktop on Windows. It does not apply to a repository that merely lacks Git metadata, a WSL Git detection error, or a general service outage.
Step 1: Confirm the Multi-Folder Failure
The reported pattern is specific:
A project works with one local folder.
You add a second folder to that project.
Codex immediately shows
"Oops, an error has occurred".Try again, restarting, or reinstalling does not recover the UI.
The error returns because the saved project still contains multiple root paths.
Several reports also recorded this renderer error:
You do not need to find that log entry before using the recovery. The timing of the failure is the safer discriminator. If the app failed before you changed project folders, stop here and use a guide for that exact symptom instead.
Step 2: Update With the App Fully Closed
First try the least invasive path:
Fully quit Codex or ChatGPT Desktop.
Open Microsoft Store and install the latest available app update.
Reopen Codex.
If it starts, keep each project to one folder until the issue is confirmed fixed on your build.
One July 25 report said build 26.721.41059 no longer crashed when a second folder was added. Another report reproduced the same failure on that build, and a July 27 comment described it as fixed without identifying a newer version. Updating is worth trying, but the evidence does not support calling one build universally safe.
If the app still opens to the same error, close it again before editing state.
Step 3: Verify Codex Is Fully Stopped
In PowerShell, run:
Expected result: no process is returned. If a Codex or ChatGPT process remains, close it from Task Manager and rerun the check.
Do not edit the files while the app is running. Codex can rewrite global state on exit and undo the repair.
Step 4: Back Up Both Global-State Files
Run:
Confirm the backups exist:
Expected result: two recent, non-empty backup files. If either source file is missing, stop rather than creating a replacement from memory.
Step 5: Remove Only the Second Root
Open the primary state file:
Find local-projects, then locate the affected project. Its shape should resemble:
Change only that project's rootPaths array to keep its original first folder:
Save the file. Repeat the same targeted edit in the fallback copy:
Do not change project IDs, names, chat records, authentication, SQLite files, skills, or repository contents. Do not clear all of .codex; that broader reset can remove unrelated local UI and project state.
Step 6: Validate Both Files Before Relaunch
Run:
Expected result:
If PowerShell reports a JSON error, do not open Codex. Restore both timestamped backups, then repeat the edit without changing commas, braces, or escaping.
Step 7: Relaunch and Verify Recovery
Open Codex and check:
The home screen loads instead of the error boundary.
Your existing chats remain visible.
The affected project opens with its original folder.
A short read-only task can inspect that folder.
Closing and reopening the app once does not restore the bad second root.
Keep the backup files until these checks pass. Use separate single-folder projects if you need both repositories in Codex.
Common Failure Modes
What you see | Likely meaning | Safe next step |
|---|---|---|
The error began before any folder change | This is probably a different Codex failure | Stop and diagnose the original trigger |
The app rewrites the second root after editing | Codex was still running or only one state copy was changed | Quit fully, restore the backups, and edit both copies |
| The manual edit broke JSON syntax | Restore both backups before trying again |
One folder remains but the error persists | Extra migration state or another bug may be active | Restore the backups and add sanitized evidence to the matching issue |
Deleting all of | Corrupt state was removed together with unrelated local data | Keep the backup; prefer the targeted |
A second folder works on your updated build | Your build may contain a partial or complete fix | Do not assume every Windows configuration is fixed |
Why the Targeted Repair Works
The affected project persists its folders in rootPaths, so restarting or reinstalling can reload the same multi-root state. Reducing only the affected array to one root removes the reproducible trigger without erasing the rest of Codex's local data.
One detailed issue analysis traced build 26.721.3996.0 to a Windows path being passed through a POSIX relative-path comparison. With two roots, the renderer reportedly reaches process.cwd() even though process is unavailable, which throws during route rendering. A single root avoids that comparison. This analysis fits the reports and the observed workaround, but it is community reverse engineering rather than an OpenAI root-cause statement.
Test One External Action After Recovery
Once Codex is stable, verify the repaired app with a bounded read-only task instead of another multi-folder experiment. In Codex, paste:
Then ask:
Expected result: Codex inspects one live Action schema, returns one read-only issue result, makes no repository change, and remains usable after restart.
Use Aident Loadout to run one connected Action. Measure success as one verified external result, zero pasted secrets, and zero local file changes.
Sources
Windows Codex Desktop becomes unstartable after adding a second folder, OpenAI Codex issue, opened July 24, 2026
Adding a second project folder permanently locks Codex, OpenAI Codex issue, opened July 24, 2026
Windows app becomes unusable after adding a second folder, OpenAI Codex issue, opened July 24, 2026
Adding a second project folder leaves Codex permanently stuck, OpenAI Codex issue, opened July 24, 2026
ChatGPT Desktop App Error: "Oops, an error has occurred", Reddit, posted July 24, 2026
Has anyone else encountered this error in the ChatGPT/Codex Windows app?, Reddit, posted July 24, 2026
Codex crashes after opening a multi-root project, OpenAI Developer Community, posted July 24, 2026
Moving to the new ChatGPT desktop app, OpenAI, accessed July 27, 2026


