[Windows] Codex Desktop login succeeds, then /accounts/{id}/settings 401 causes auth_token_missing and a reauthentication loop (26.820.7780.0)
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:
- #40374 —
/accounts/{account_id}/settings401 followed by lost access token - #40699 —
hadToken=true→auth_token_missing→ repeated sign-in - #39925 — unrelated settings 401 followed by rejection/discard of fresh authentication state
- #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.
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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.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.
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.
Additional Windows reproduction on the exact same stable Codex Desktop package (
26.820.7780.0), using a ChatGPT Plus account. This reproduction does not have Advanced Account Security enabled.Environment / versions:
Microsoft Windows NT 10.0.26200)OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0OpenAI.ChatGPT-Desktop 1.2026.190.026.826.112500.150.1, authenticated with the same ChatGPT account and working normallyReproduction:
Representative sanitized log sequence:
Troubleshooting/control tests already performed:
CODEX_ACCESS_TOKENis absent at both User and Machine environment scopes.%USERPROFILE%\.codex\auth.jsonand performed a fresh ChatGPT login.auth.json, but Desktop still returned to the sign-in loop.This strongly matches the existing issue's cached-token 401 ->
auth_token_missing->account_info_token_unavailablefailure chain. The CLI/web controls plus freshauth.jsonregeneration suggest the persistent credential/account itself remains valid while the stable Windows Desktop runtime loses or stops attaching the access token.No access tokens, refresh tokens, cookies, account IDs, email addresses, or raw authentication files are included.
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
| Date/time (JST) | Test | Result | Notes |
|---|---|---|---|
| 2026-08-27 | Logged out all active ChatGPT sessions, then signed in to Codex Desktop again | Pass | Immediate authentication loop no longer reproduced |
| 2026-08-27 | Sent messages and opened projects/conversations | Pass | No unexpected logout |
| 2026-08-27 | Full Codex Desktop restart | Pass | Authentication loop did not recur |
| 2026-08-27 | Windows restart | Pass | Codex Desktop remained operational after reboot |
| 2026-08-27 | Codex Desktop update followed by normal use | Pass | Continued working normally after the update |
| 2026-08-27 | Signed in through ChatGPT web and the mobile app | Pass | The original Codex Desktop session remained operational |
| 2026-08-27 | Signed in on a separate PC while continuing to use the original PC | Pass | Multi-device sign-in did not reproduce the authentication loop |
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.