Skip to content

[Windows] Codex Desktop login succeeds, then /accounts/{id}/settings 401 causes auth_token_missing and a reauthentication loop (26.820.7780.0) #40761

Open

Description

@robjarawan

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?

  1. Start Codex Desktop on Windows.
  2. Select Sign in with ChatGPT.
  3. Complete the browser sign-in using the configured passkey/security key.
  4. Return to Codex Desktop; the app initially shows the account as authenticated.
  5. Open or continue a thread, or wait for the account-settings refresh.
  6. Within seconds or minutes, Desktop receives a 401 from /accounts/{account_id}/settings, changes to auth_token_missing, and asks for authentication again.
  7. 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:

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

  1. added
    bug
    on Aug 26, 2026
  2. added
    app
    windows-os
    auth
    on Aug 26, 2026
  3. changed the title [-][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)[/+] on Aug 26, 2026
  4. robjarawan commented on Aug 26, 2026

    @robjarawan
    Author

    Workaround validation (2026-08-26): I installed the Microsoft Store ChatGPT (Beta) side-by-side (AppX package 26.727.4816.0; runtime reports 26.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_401
    • auth_token_missing
    • Missing valid access token
    • HTTP status_code: 401

    Stable 26.820.7780.0 remains 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.

  5. neo-cube commented on Aug 26, 2026

    @neo-cube

    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:

    desktop_fetch_auth_401 hadToken=true
    target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
    
    authMethod=chatgpt
    hasToken=false
    nullReason=auth_token_missing
    refreshToken=true
    tokenExpiryState=missing
    
    failureType=account_info_token_unavailable
    errorMessage="Missing valid access token or actor biscuit"
    status=401
    

    The following desktop-side causes were tested without resolving the issue:

    • Reset the MSIX web profile and cache.
    • Re-registered the Windows Appx package manifest.
    • Tested with a completely new isolated CODEX_HOME.
    • Reauthenticated through the ChatGPT browser flow with fresh credentials.
    • Fully uninstalled the MSIX package and removed its app-local cache.
    • Reinstalled the official Microsoft-signed package.
    • Confirmed the package registration status is Ok.
    • Confirmed that no proxy is configured and HTTPS certificate validation succeeds for chatgpt.com and auth.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 displays Oops, an error has occurred while 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.

  6. neo-cube commented on Aug 26, 2026

    @neo-cube

    Additional trigger and regional context:

    • The issue began shortly after enabling SMS two-step authentication and adding a password in the account Security/Login settings.
    • This reproduction is from Japan (JST), with no configured proxy.

    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.

  7. serkan1712 commented on Aug 28, 2026

    @serkan1712

    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.

  8. neo-cube commented on Aug 28, 2026

    @neo-cube

    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 401 response, lose its local authentication token, and return to the sign-in screen.

    The relevant log sequence was:

    hadToken=true
    GET /backend-api/accounts/:param/settings -> 401
    hasToken=false
    auth_token_missing
    

    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

    1. Open the ChatGPT web application.
    2. Open Settings → Security.
    3. Locate the active login sessions/devices.
    4. Select log out of all active sessions/devices.
    5. Sign in to the Windows Codex Desktop app again using the normal ChatGPT browser-authentication flow.
    6. Send a message and open an existing project to confirm that the desktop session remains authenticated.

    Important: Logging out all active sessions signs the account out on other browsers and devices. Save in-progress work before doing this.

    Verification completed

    • Fresh Codex Desktop login succeeded after all active sessions were logged out.
    • New chat messages could be sent without returning to the sign-in screen.
    • Existing projects and conversations opened normally.
    • Codex Desktop could be fully closed and reopened without recurrence.
    • Windows restarted without recurrence.
    • Normal operation remained stable after a subsequent Codex Desktop update.
    • ChatGPT web and mobile app sign-ins succeeded without disrupting the original Codex Desktop session.
    • Signing in on a separate PC did not disrupt the original Codex Desktop session.
    • Continued normal use did not reproduce the authentication loop.

    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.

  9. chelebyy commented on Aug 28, 2026

    @chelebyy

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appauthbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions