Repository navigation
Description
What version of Codex CLI is running?
0.150.0-alpha.8 (bundled with Codex Desktop 26.820.7780.0)
What subscription do you have?
Pro
Which model were you using?
GPT-5.6-sol
What platform is your computer?
Windows 11 (10.0.26200, x64)
What terminal emulator and version are you using (if applicable)?
Not applicable — this occurs in Codex Desktop.
Codex doctor report
Ran the bundled codex doctor --json after closing Codex Desktop. Relevant redacted results:
overallStatus: warning
codexVersion: 0.150.0-alpha.8
auth.credentials: ok — auth configured; stored ChatGPT tokens present
config.load: ok
desktop.app.version: ok — 26.820.7780.0 installed
network.provider_reachability: ok
network.websocket_reachability: ok — HTTP 101 Switching Protocols
state database integrity checks: ok
security.endpoint: warning — Microsoft Defender exclusions unverified
The Defender warning does not correspond to the observed authentication sequence. Because Desktop was closed, the live Desktop/app-server handshake was skipped.
What issue are you seeing?
Codex Desktop records browser-based ChatGPT/passkey authentication as successful and briefly recognizes the authenticated account. Seconds later, a request to /backend-api/accounts/{account_id}/settings made with the cached token receives HTTP 401. Desktop then changes its state to hasToken=false / auth_token_missing, stops attaching the token, and returns to the sign-in flow.
The security-key prompt is therefore the visible consequence of repeated reauthentication; the key interaction itself completes successfully.
Strongest observed sequence on August 25, 2026 (America/Toronto, UTC-04:00):
22:38:30.588 account_login_completed success=true
22:38:31.438 authenticatedAccountPresent=true result=succeeded
22:38:39.024 desktop_fetch_auth_401 hadToken=true tokenSource=cached willRetry=true
22:38:39.269 hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing
22:38:39.485 /accounts/{account_id}/settings -> 401 "Missing valid access token or actor biscuit"
The token was issued at 22:38:30, was unexpired, and its stored account ID matched the ID-token claim, access-token claim, and request URL. No token values or account identifiers are included here.
I observed nine instances of the cached-token 401 → auth_token_missing collapse across three Codex Desktop process sessions. The problem persisted across application restarts.
Installed versions:
- Codex Desktop:
26.820.7780.0 - Bundled Codex CLI/app-server:
0.150.0-alpha.8 - ChatGPT Desktop:
1.2026.190.0
What steps can reproduce the bug?
- Start Codex Desktop on Windows.
- Select Sign in with ChatGPT.
- Complete the browser sign-in using the configured passkey/security key.
- Return to Codex Desktop; the app initially shows the account as authenticated.
- Open or continue a thread, or wait for the account-settings refresh.
- Within seconds or minutes, Desktop receives a 401 from
/accounts/{account_id}/settings, changes toauth_token_missing, and asks for authentication again. - Repeat the sign-in; it succeeds again and the same sequence recurs.
Uploaded thread: 01a03bef-5da3-7542-865a-7b1e4fe9a4c5
What is the expected behavior?
After a successful ChatGPT/passkey sign-in, Codex Desktop should retain and attach the newly issued authentication token. A 401 from an account-settings request should not discard otherwise usable authentication state or trigger an endless security-key/sign-in loop.
Additional information
Representative local log:
AppData/Local/Packages/OpenAI.Codex_2p2nqsd0c76g0/LocalCache/Local/Codex/Logs/2026/08/26/
codex-desktop-9b76f5f2-df43-4f24-bd42-3c7f7e3df3b7-19316-t0-i1-022543-0.log
Related open reports with closely matching sequences:
- Windows Desktop loses access token and returns to login after /accounts/{account_id}/settings 401 #40374 —
/accounts/{account_id}/settings401 followed by lost access token - Codex Desktop for Windows – authentication loop after opening local project #40699 —
hadToken=true→auth_token_missing→ repeated sign-in - Windows Desktop: fresh ChatGPT refresh token is rejected as refresh_token_invalidated on its first isolated refresh, causing false logout after unrelated 401 #39925 — unrelated settings 401 followed by rejection/discard of fresh authentication state
- Windows desktop app loses ChatGPT authentication within 15–40 seconds after enabling Advanced Account Security; Codex CLI remains logged in #39170 — successful login followed by 401/auth loop with Advanced Account Security
The broader issue reproduces in reports both with and without Advanced Account Security, so passkeys/security keys appear to expose the loop but may not be the root cause.
Activity
github-actions commentedon Aug 26, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-][Windows] Codex Desktop accepts ChatGPT/passkey login, then loses the valid access token and loops reauthentication (26.820.7780.0)[/-][+][Windows] Codex Desktop login succeeds, then /accounts/{id}/settings 401 causes auth_token_missing and a reauthentication loop (26.820.7780.0)[/+]robjarawan commentedon Aug 26, 2026
Workaround validation (2026-08-26): I installed the Microsoft Store ChatGPT (Beta) side-by-side (AppX package
26.727.4816.0; runtime reports26.727.40816) without uninstalling stable or clearing credentials.Beta loaded the authenticated account and opened the exact previously triggering recent thread, “Avery Label Design (2)”, normally. I monitored it for 35 seconds after opening; the Beta process remained alive and its fresh diagnostic scope contained 0 occurrences of:
desktop_fetch_auth_401auth_token_missingMissing valid access tokenstatus_code: 401Stable
26.820.7780.0remains installed, so this is a confirmed temporary workaround and additional evidence that the loop is a regression in the stable build line—not proof of an upstream fix.neo-cube commentedon Aug 26, 2026
Additional Windows reproduction on the same Codex Desktop build (
26.820.7780.0).The failure reproduces 100% after successful ChatGPT browser authentication when sending a message or opening an existing project:
The following desktop-side causes were tested without resolving the issue:
CODEX_HOME.Ok.chatgpt.comandauth.openai.com.The Codex IDE extension remains signed in and functional with the same ChatGPT account, including while the desktop app repeatedly returns to the login screen. This appears specific to the desktop authentication path rather than a general account sign-in failure.
One additional impact: using Logout in Codex Desktop removes the shared
%USERPROFILE%\.codex\auth.json, which also signs the IDE extension out. After logout, the desktop UI displaysOops, an error has occurredwhile continuing unauthenticated backend calls.These results make local cache corruption, installation damage, proxy/TLS failure, and shared-home contention unlikely. The remaining lead is the desktop authentication bridge or account-token/actor-biscuit compatibility: the token is present before the account-settings 401 and becomes unavailable immediately afterward.
neo-cube commentedon Aug 26, 2026
Additional trigger and regional context:
The timing does not prove causation, but it may be relevant given the similar authentication-loop reports associated with account security changes (for example, #39170 and #39685). No phone number, password, account identifier, IP address, or other authentication data is included here.
serkan1712 commentedon Aug 28, 2026
Resolved on my Windows machine. Codex Desktop is working normally again and I have resumed project work. I am no longer reproducing the 401 -> auth_token_missing -> account_info_token_unavailable login loop.
Keeping this brief update for historical context; no further follow-up is needed from me unless the issue returns.
neo-cube commentedon Aug 28, 2026
Update: account-session reset resolved the authentication loop in my environment
After further troubleshooting, I found an account-session reset that resolved the Windows Codex Desktop authentication loop in my environment.
Original failure
ChatGPT browser authentication completed successfully and the Codex Desktop UI initially appeared. However, sending a message or opening an existing project caused the app to receive a
401response, lose its local authentication token, and return to the sign-in screen.The relevant log sequence was:
The issue reproduced consistently after resetting the desktop profile, using a separate
CODEX_HOME, and fully reinstalling the Windows package. The Codex IDE extension continued to work with the same ChatGPT account.Workaround
Verification completed
Outcome log
Why this result is significant
Desktop-side recovery steps did not resolve the issue, while invalidating all account sessions did. This suggests that stale or inconsistent account-side session state may have been involved rather than only local cache corruption or a damaged installation.
This does not establish the exact root cause. One possible interpretation is that the desktop authentication flow received credentials that were accepted during browser login but rejected by the subsequent account-settings request. Invalidating every active session may have forced the account and desktop app to establish a fully fresh session.
Relevant account context
The authentication loop began shortly after changes under the account's Security / Login settings, including adding a password and enabling SMS MFA. The timing does not prove causation, but it may be relevant to the account-side session state.
This should be treated as an account-specific workaround, not a universal fix. Similar-looking authentication failures may have different causes, and signing out all active sessions has not resolved every related report.
If the issue recurs, I will record the exact time, the operation immediately preceding the logout, whether the log again shows
hadToken=true -> 401 -> hasToken=false, and whether the same account-session reset resolves it a second time.chelebyy commentedon Aug 28, 2026
I’m seeing a closely related Windows Codex Desktop failure pattern. In my case, sign-in succeeds, but Desktop later loses auth/session state and I also get intermittent conversation creation failures,
no rollout found for thread id, and now a new acknowledgement error saying the submission/task creation has not yet been acknowledged and should not be resent. Codex CLI works normally on the same Windows machine with the same account. My tracking issue is openai/codex #40704.