Codex Desktop loses ChatGPT access token and returns to sign-in after enabling Advanced Account Security
What version of the Codex App are you using (From “About Codex” dialog)?
26.814.41407
What subscription do you have?
ChatGPT Pro 20x
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
Description
After enabling Advanced Account Security on my ChatGPT account, Codex Desktop on macOS started repeatedly returning to the sign-in screen when I tried to send a message in a local Codex session.
I later disabled Advanced Account Security, logged out and back in from both Codex CLI and the desktop app, and restarted the Mac, but the issue persists.
My ChatGPT account was originally created using Sign in with Google. I am not sure whether this is related, but I am including it because the issue started immediately after changing the account security settings.
Actual behavior
- Codex Desktop initially recognizes the ChatGPT account as authenticated.
- Local threads and worktrees load normally.
- When Codex performs an authenticated request / I try to use a local session, an authenticated request returns 401.
- Codex then loses the access token.
- The desktop app considers the account unauthenticated and returns to the sign-in screen.
- Signing in again temporarily succeeds, but the same behavior repeats.
The relevant log sequence is:
desktop_fetch_auth_401 hadToken=true ... willRetry=true
app_server_connection.auth_status_result
authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
chatgpt-account-lookup
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
result=failed
After that, requests fail with:
Missing valid access token or actor biscuit
and subsequent requests show:
desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
Troubleshooting already attempted
I have already tried all of the following:
- Disabled Advanced Account Security again.
- Logged out and back in using the regular Codex CLI.
- Logged out and back in using the Codex binary bundled with ChatGPT.app:
``text``
/Applications/ChatGPT.app/Contents/Resources/codex
- Removed/recreated
~/.codex/auth.json. - Confirmed there is no
CODEX_ACCESS_TOKENenvironment variable. - Confirmed there are no explicit auth overrides such as:
cli_auth_credentials_storeforced_login_methodchatgpt_base_urlmodel_provider- Restarted ChatGPT Desktop.
- Restarted macOS.
- Tested with a clean
CODEX_HOME.
None of these restored normal authentication in my regular Codex Desktop environment.
Additional diagnostic result
With my normal ~/.codex, Codex initially reports the account as authenticated:
chatgpt-account-lookup
authenticatedAccountPresent=true
authMethod=chatgpt
result=succeeded
The failure only happens later, after an authenticated request receives a 401. At that point the access token disappears from the app's auth state even though a refresh token still appears to exist:
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
This makes the issue look like an access-token refresh / desktop auth bridge failure, rather than a simple failed login.
Environment
- macOS
- ChatGPT Desktop with integrated Codex
- Bundled Codex app-server version observed in logs:
0.148.0-alpha.15 - Local Codex sessions / worktrees
- Account originally created with Google sign-in
- Issue began immediately after enabling Advanced Account Security
- Advanced Account Security is now disabled, but the problem remains
Possibly related issues
This appears similar to other reports involving Codex Desktop losing or failing to refresh ChatGPT OAuth tokens, but my case has a specific trigger: enabling Advanced Account Security on an existing Google-linked account.
In particular, the important behavior in my case is:
authenticated → hadToken=true → 401 → auth_token_missing → hadToken=false → sign-in screen
What steps can reproduce the bug?
Steps that triggered the issue
- Existing ChatGPT account, originally created using Sign in with Google.
- Codex Desktop was working normally.
- Enabled Advanced Account Security in ChatGPT account settings.
- Opened Codex Desktop.
- Attempted to send a message in an existing local session.
- Codex returned to the sign-in screen.
- Disabled Advanced Account Security again.
- Logged out and back in.
- Problem continued.
What is the expected behavior?
Expected behavior
After a successful ChatGPT login, Codex Desktop should retain or correctly refresh the access token and continue using local sessions without returning to the sign-in screen.
Disabling Advanced Account Security and performing a fresh login should also restore a valid Codex session.
Additional information
The account was originally created using Sign in with Google.
The issue started immediately after enabling Advanced Account Security. Disabling Advanced Account Security afterward did not restore Codex Desktop authentication.
The desktop initially detects the account successfully, but after the first authenticated 401 response the access token becomes unavailable while a refresh token still appears to exist.
Bundled Codex app-server version observed in logs: 0.148.0-alpha.15.
I can provide a redacted full desktop log if useful.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Had the same issue and this solves it https://github.com/openai/codex/issues/39170#issuecomment-5351649033