[Bug][Windows Desktop 26.820.9563.0 / Codex CLI] Chronic Auth De-sync, Infinite Login Loop, and Off-screen Bounds
Open 💬 2 comments Opened Aug 28, 2026 by jyongchul
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
Summary
We are reporting a critical set of chronic bugs affecting the Windows ChatGPT Desktop App (UWP/Electron package: OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0) and Codex CLI (v0.150.0-alpha.8) on Windows 10/11 environments.
These issues lead to severe user frustration, frequent de-authentications, unrecoverable OAuth loading loops ("Continue signing in with your browser"), and window rendering failures where the window is placed at off-screen negative coordinates.
---
Environment
- Operating System: Windows 11 / Windows 10 (x64) + WSL2
- ChatGPT Desktop App Version:
OpenAI.Codex_26.820.9563.0_x64__2p2nqsd0c76g0 - Codex CLI Version:
v0.150.0-alpha.8(Codex App Tools bundled:server.mjs) - Browser: Google Chrome / Microsoft Edge (Default)
---
Key Issues & Root Cause Analysis
1. Chronic De-authentication & Infinite "Continue signing in with your browser" Loop
- Symptom:
- The desktop app randomly drops active user sessions and resets to the landing screen ("Sign in to ChatGPT").
- Clicking "Continue to sign in" transitions the app into "Continue signing in with your browser" with a single
[Cancel sign-in]button. - The local OAuth server spawns on
http://localhost:1455(or dynamic ports), but if the browser does not automatically navigate to the generated OAuth URL or if the protocol handler callback (codex://orhttp://localhost:1455/auth/callback) is blocked/delayed by Windows sandbox restrictions, the app deadlocks indefinitely. - Root Cause:
- The UWP AppContainer isolation (
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\Codex\web\Codex) fails to reliably sync token state with%APPDATA%\Codex\auth.jsonand~/.codex/auth.json. - Even when
--device-authsucceeds in CLI, the desktop Electron webview does not listen for file changes or re-read tokens without a manual process teardown.
2. Window Bounds Rendered Off-Screen at Negative Coordinates (-1920, -1040)
- Symptom:
- The app process (
ChatGPT.exe) runs with high CPU/memory in Task Manager and reportsMainWindowTitle: ChatGPT, but no window appears on any connected display. MainWindowHandlefrequently evaluates to0or points to an off-screen viewport.- Root Cause:
- In
.codex-global-state.json,electron-main-window-boundsis frequently written with negative coordinates, e.g.:
``json``
"electron-main-window-bounds": {
"x": -1920,
"y": -1040,
"width": 1918,
"height": 2076,
"isMaximized": false
}
- The app lacks bounds sanitization/clamping against current active virtual screen bounds during startup.
3. UTF-8 BOM JSON Parsing Crash on Startup
- Symptom:
- The app silently terminates immediately after launch without opening any window or UI.
- Root Cause:
- If
.codex-global-state.jsoncontains a UTF-8 Byte Order Mark (\xef\xbb\xbf), Electron'sJSON.parse()throws a fatal syntax error before window creation.
---
Reproduction Steps
- Install
OpenAI.Codex_26.820.9563.0on Windows 11 with WSL2 enabled. - Sign in using the default browser OAuth flow.
- Work across multiple sessions or restart the computer / close the app.
- Observe that:
- The app randomly returns to "Sign in to ChatGPT" / "Continue signing in with your browser".
- The window occasionally vanishes due to negative coordinates written to
.codex-global-state.json.
---
Suggested Fixes & Recommendations
- OAuth UI Fallback: Provide an interactive Device Code entry (
auth.openai.com/codex/device) directly within the desktop UI instead of relying solely on localhost port callbacks. - Window Bounds Sanitization: On startup, validate
electron-main-window-boundsand reset(x, y)to primary monitor center if coordinates fall outside visible display geometry. - Robust JSON Parsing: Strip BOM automatically before parsing state JSON files (
content.replace(/^\uFEFF/, '')). - Unified Token Sync: Ensure UWP AppContainer and Win32 CLI share a unified, persistent credential cache.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional Production Diagnostic: Spontaneous Mid-Session De-Authentication (Token Refresh Drop in AppContainer)
Observed Behavior:
--device-authand actively using local thread sessions (loaded from localthread_history_1.sqlite), the desktop UI abruptly reloads mid-session and reverts to"Continue signing in with your browser"/[Cancel sign-in].Technical Root Cause:
%LOCALAPPDATA%\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Roaming\Codex) and the Win32 auth path (%APPDATA%\Codex\auth.json/~/.codex/auth.json) causes a 401 Unauthorized or timeout during silent refresh.Workaround / Fix Needed: