Codex Desktop loses ChatGPT access token and returns to sign-in after enabling Advanced Account Security

Open 💬 2 comments Opened Aug 20, 2026 by yeeun-uwu
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

  1. Codex Desktop initially recognizes the ChatGPT account as authenticated.
  2. Local threads and worktrees load normally.
  3. When Codex performs an authenticated request / I try to use a local session, an authenticated request returns 401.
  4. Codex then loses the access token.
  5. The desktop app considers the account unauthenticated and returns to the sign-in screen.
  6. 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_TOKEN environment variable.
  • Confirmed there are no explicit auth overrides such as:
  • cli_auth_credentials_store
  • forced_login_method
  • chatgpt_base_url
  • model_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

  1. Existing ChatGPT account, originally created using Sign in with Google.
  2. Codex Desktop was working normally.
  3. Enabled Advanced Account Security in ChatGPT account settings.
  4. Opened Codex Desktop.
  5. Attempted to send a message in an existing local session.
  6. Codex returned to the sign-in screen.
  7. Disabled Advanced Account Security again.
  8. Logged out and back in.
  9. 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.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 8 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39170
  • #39162
  • #39491

Powered by Codex Action

aminya · 8 days ago