Codex crashing Windows desktop app with one account only

This is an odd problem, so I had an account I was using with the desktop app fine using codex, got a new account paid for by work so I had to set it up with a new email. When I was using my old account it was working fine on this desktop system with projects, set up the new account I turned on the advanced security features and added a passkey / yubikey combo (I didnt add these with my personal account) logged in fine, went into the desktop app fine with codex started a new project gave it a task, soon as the task was done it showed me the output text and it immediately closed and went to the login screen…

I logged in again loaded fine soon as i clicked on the chat i had on the project same thing… closed and went to login.. tried it a few more times didnt stop.. started a new chat, same symptoms..

logged out of that account, logged in with my old one, works fine, can open that same chat no crash or log out…

swapped back to the new one and instant crash on clicking the chat or log out..

what in the world is going on? I disabled the advanced security and took off the yubikey/passkey thinking that might be at play and still showing this behavior on the new account. and only on the new account.

100% what is happening to me, as I use Daybreak and am being forced to set up passkeys, I did so yesterday, and I am now in a login loop. As soon as I start a new chat or read an old one, I get logged out. It is fine in the classic app (not good for Codex) , mobile and browser. Also fine if I use Codex on a different machine. As per usual, OpenAI support has been useless.

This is what i sent to Support:

Codex Desktop on Windows signs me out whenever I create a new conversation. The issue began after moving my OpenAI account to passkey authentication.

All active OpenAI sessions have been revoked and Advanced Account Security has been disabled for troubleshooting.

Codex application state has been fully reset, including the Electron profile and MSIX local state. Native Codex authentication state was also reset by removing and regenerating ~/.codex/auth.json and cap_sid.

A fresh auth.json is successfully generated after login, confirming that authentication itself completes successfully.

Creating a new Codex conversation immediately causes the client to lose authentication again.

Codex logs show repeated requests to /backend-api/wham/tasks/list failing with HTTP 401 and specifically:

desktop_fetch_auth_401 hadToken=false

skipRetryReason=no_token_attached

tokenSource=cached

willRetry=false

followed by:

errorMessage={“detail”:“Unauthorized”}

There are no CODEX_ACCESS_TOKEN or OPENAI_API_KEY environment variables configured.

This appears consistent with the existing Codex Desktop authentication bridge issue where valid ChatGPT authentication exists on disk but the desktop client fails to attach the access token to ChatGPT backend requests.

Affected Codex package: OpenAI.Codex_26.818.2441.0_x64__2p2nqsd0c76g0

Windows platform, x64.

Welcome to the forum!

You are welcome to discuss Codex issues here. However, the official place to report and track them is the OpenAI Codex GitHub issue tracker.

I asked ChatGPT to look for the closest related issue, and it identified:

If that issue matches your problem, consider adding a :+1: reaction on the GitHub issue itself—not only on this forum topic. Reactions on GitHub can help the developers gauge the number of affected users.

If it does not describe the same problem, search the existing Codex issues for a closer match. If you cannot find one, open a new issue and include as much relevant detail as possible.

[Windows][Codex Desktop][Auth] Advanced Account Security causes successful login to fail with HTTP 401 / auth_token_missing

I am reporting a reproducible authentication issue with Codex Desktop on Windows when Advanced Account Security (AAS) is enabled on my ChatGPT account.

I have reproduced the issue multiple times and performed an A/B test by changing only the Advanced Account Security state.

Summary

With Advanced Account Security enabled, Codex Desktop successfully completes the ChatGPT authentication flow, including hardware-based authentication.

The browser reports that the login is successful, and Codex Desktop initially recognizes the account as authenticated and opens the workspace normally.

However, shortly afterward, Codex loses authentication and returns to the sign-in screen.

With Advanced Account Security disabled, the same ChatGPT account on the same Windows PC and same Codex Desktop installation remains authenticated and works normally.

A/B reproduction

Advanced Account Security: ON

Result:

ChatGPT authentication succeeds
→ Codex receives authenticated account
→ authenticatedAccountPresent=true
→ account settings request returns HTTP 401
→ auth_token_missing
→ account_info_token_unavailable
→ authenticatedAccountPresent=false
→ Codex returns to sign-in

This behavior is reproducible.

Advanced Account Security: OFF

Same:

  • ChatGPT account

  • Windows PC

  • network

  • Codex Desktop installation

Result:

Login succeeds
→ Codex remains authenticated
→ Codex works normally

The only intentional change between these two tests was the Advanced Account Security state.

Environment

  • Platform: Windows

  • Application: Codex Desktop

  • Package observed in diagnostic log: OpenAI.Codex_26.818.5229.0_x64

  • Authentication: Sign in with ChatGPT

  • Advanced Account Security: Enabled when the failure occurs

  • Authentication method: hardware-based authentication

  • VPN/proxy: None enabled during testing

Diagnostic evidence

The diagnostic log confirms that the initial login succeeds:

account_login_completed ... success=true

Codex then recognizes the account as authenticated:

authenticatedAccountPresent=true
authMethod=chatgpt
failureType=undefined
result=succeeded

So this does not appear to be a failure of the initial browser/OAuth authentication.

The failure occurs afterward.

Codex later makes an authenticated request to the account settings endpoint and receives HTTP 401:

desktop_fetch_auth_401
hadToken=true
target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
tokenSource=cached
willRetry=true

Immediately afterward:

authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing

The following authenticated request then fails with:

Missing valid access token or actor biscuit
status=401

Finally, Codex reports:

authenticatedAccountPresent=false
authMethod=chatgpt
failureType=account_info_token_unavailable
result=failed

At that point, the application returns to the signed-out state.

Important observation

The interesting part is that the log reports:

hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing

So the initial authentication succeeds and a refresh token is still reported as present, but the desktop application subsequently loses the usable authenticated state after the 401 response.

Codex runtime itself starts normally

The diagnostic log also shows that the bundled Codex app-server starts successfully:

stdio_transport_spawned
Transport start success
initialize_handshake_result ... outcome=success
Codex CLI initialized

Therefore, this does not appear to be a simple Codex runtime startup failure.

Expected behavior

Advanced Account Security should be compatible with Codex Desktop authentication.

After successfully completing hardware-backed authentication, Codex Desktop should maintain the authenticated session or correctly perform any reauthentication/token refresh required by AAS.

Actual behavior

With AAS enabled:

Successful authentication
→ temporary authenticated state
→ HTTP 401
→ access token unavailable
→ auth_token_missing
→ account_info_token_unavailable
→ signed out

With AAS disabled:

Successful authentication
→ authenticated session remains active
→ Codex works normally

What this evidence establishes

I am not claiming that the logs prove whether the root cause is client-side or server-side.

What I can reproduce is:

AAS enabled → authentication consistently fails shortly after a successful login.

AAS disabled → the same account and same Windows installation work normally.

This appears to be a compatibility issue somewhere in the authentication/token lifecycle between Advanced Account Security and Codex Desktop on Windows.

I have already reported this to OpenAI Support and can provide the complete diagnostic log privately if requested.

I am intentionally not posting the full raw log publicly because it contains account-specific identifiers and local system information.

Questions for OpenAI / other users

  1. Is this a known issue with Advanced Account Security and Codex Desktop on Windows?

  2. Has anyone else reproduced the same 401 → auth_token_missing → account_info_token_unavailable sequence?

  3. Is the immediate loss of the access token after successful AAS authentication expected behavior?

  4. Is there a supported workaround that does not require disabling Advanced Account Security?

I would prefer not to weaken my account security simply to keep Codex Desktop authenticated.

If anyone with AAS enabled can reproduce this on Windows, please share your sanitized logs and Codex version so we can determine whether this affects multiple accounts.

Same as @mansfield1161 and @PrB . This crash seems to be trigger by the switch of accounts, not the AAS-on. I turn the AAS off and met this crash again.

Hi @mansfield1161, sorry it’s taken a while. We’re working through our backlog now. Can you close Codex, sign out of both ChatGPT accounts in the browser you use for login, then sign in with only your work account and reopen Codex? Other Windows users reported that this stopped a similar sign-out loop. Let us know how it goes!