Codex App window exits when opening or resuming threads after auth_token_missing / browser pane initialization
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.2872.0
What subscription do you have?
ChatGPT Pro x20
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
On Codex App for Windows, opening or resuming a thread can make the primary Electron window disappear. There is no Windows Application Error, WER report, or crash dump.
The app logs show this sequence:
thread/readandthread/resumesucceed.- A Browser Use host is created for the thread route (
browserPane=true). - The route window becomes unavailable (
route window is not live,hasWindowState=false). - Authentication falls back to
auth_token_missing/ HTTP 401 (Missing valid access token or actor biscuit/Unauthorized). - IPC fails with
EPIPE, then the app server stops withstop_process.
The issue reproduced repeatedly on the same day after reset, reinstall, and reboot, including with both old and newly created threads. Local thread rollouts and SQLite databases pass integrity checks, so this does not appear to be corruption of one conversation.
This may be related to #35740 / #35352, but there is no GPU process crash line in these logs, so I cannot confirm the same root cause.
What steps can reproduce the bug?
- Start Codex App on Windows.
- Open an existing thread, or create a new thread and navigate to it.
- The thread initially opens/resumes successfully.
- Within a few seconds, the main Codex window disappears.
Troubleshooting already performed:
- Reinstalled the same Codex App version and rebooted Windows.
- Verified JSON/JSONL state and SQLite databases; no corruption found.
- Removed an old UTF-8 BOM from
config.toml; TOML parsing succeeds. - Disabled
features.computer_use,features.browser_use, and browser/computer-use plugins as a reversible diagnostic. - Ran
codex exec --strict-config --ephemeral; configuration and ChatGPT authentication both succeeded. - The desktop app partially restored some browser/computer-use settings on startup, and navigating to a thread still reproduced the exit.
No local chat history or databases were deleted.
What is the expected behavior?
Opening or resuming a thread should keep the Codex window and app server running. If authentication expires, the app should show a recoverable sign-in error instead of losing the renderer/window and terminating the app server.
Additional information
Observed on Codex App 26.818.2872.0, Windows x64.
GitHub suggests #32040 as a potential duplicate. That issue covered Windows exits during in-app Browser/PiP initialization and was closed as fixed on July 17, 2026. The current reproduction is on the newer 26.818.2872.0 build, so it may be a regression. In this case, opening or resuming ordinary threads creates a browser-pane host and is followed by route-window loss, repeated auth_token_missing / HTTP 401 errors, EPIPE, and app-server stop_process.
A closely related report is #35740 (closed as duplicate of #35352). There is no explicit GPU-process crash line in the current logs, so I cannot confirm the same root cause.
no-active-thread-01a02047-94cd-7431-ad37-248f5a8d4ef4
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Follow-up diagnostics and local repair (Windows, 2026-08-21, Europe/Moscow)
I found a more specific local persistence failure in addition to the authentication/app restart symptoms.
Environment
-----------
Direct thread-store evidence
-----------------------------
Before repair, read-only inspection of thread_history_1.sqlite showed:
The state database maps this thread to its canonical rollout JSONL. The JSONL around the failure is:
Therefore the projector can advance to expected ordinal 46 after the first ordinal-45 record, but the immediately following duplicate ordinal-45 record fails with:
This explains the repeated warning loop and the inability to persist or resume the thread. It is a logical projection/ordinal problem, not ordinary SQLite corruption. It is also consistent with the failure family described in upstream issues #35746 and #38792: derived thread-history state can become permanently out of sync with the canonical rollout.
Authentication and process lifecycle
-------------------------------------
The same incident also contains an independent auth failure:
This was followed by repeated Codex AppX container/process replacement. No Application Error, WER, .NET Runtime, or crash-dump event was recorded. The auth failure may trigger the bad recovery path, but it does not explain the duplicate ordinal by itself.
Safe local repair attempted
----------------------------
With Codex processes stopped, I created a backup of thread_history_1.sqlite and deleted only the derived rows for the affected thread from:
The canonical rollout JSONL and other threads were not modified. This is the repair/workaround described by upstream issue #38792: the next resume should rebuild the derived projection from the durable rollout. The backup is retained locally as:
After restarting Codex, the application processes remained alive during the initial observation. The affected thread had not yet been opened again, so the rebuilt projection still needs to be verified on resume. If the current projector rejects the duplicate ordinal during a full rebuild, the product needs an idempotent/replayed-ordinal recovery path rather than treating the derived SQLite projection as authoritative.
Requested investigation
-----------------------
Raw SQLite logs were not attached because they contain authentication headers/cookies. The sanitized observations above are reproducible from the local projection state and rollout structure without exposing credentials.
Local mitigation now applied
----------------------------
To prevent the Windows Desktop client from re-enabling the suspected route while this issue is investigated, I added a machine-level
requirements.tomlpolicy. It pins the following features tofalsefor every local Codex client:in_app_browser,browser_use,browser_use_external,browser_use_full_cdp_access,computer_use, andmulti_agent.This uses the documented Windows managed-requirements location (
%ProgramData%\\OpenAI\\Codex\\requirements.toml), rather than relying only on a userconfig.tomlpreference that the Desktop app can rewrite. The global Browser and Chrome bundled plugins are also disabled. Existing chats and canonical rollout files were not removed.Because the server had already invalidated the saved OAuth refresh token, I moved the local
auth.jsonto a same-directory backup and restarted Codex. This intentionally forces a fresh interactive sign-in; it does not revoke or expose credentials. The app should be evaluated only after that sign-in completes, using a new small chat first.Related issues:
Live-validation update: a second Codex client was running at the same time from
the Windsurf IDE extension. The exact
refresh_token_invalidatedlog entrieswere attributed by
process_uuidto that process (pid:35420), not to theDesktop client's Codex process. The extension automatically respawned the
client after it was stopped, and both clients had been sharing
%USERPROFILE%\\.codex(auth, logs, and history).For a practical temporary workaround, I configured Windsurf's
chatgpt.cliExecutableto invoke its bundled CLI through a small wrapper thatsets
CODEX_HOMEto a separate empty directory. This isolates itsauthentication, logs, and thread history from Codex Desktop. Reload or restart
Windsurf before testing; Windsurf will require its own sign-in. Do not run both
clients against the same local Codex home while investigating this issue.