Codex Desktop login loop on macOS while CLI works; auth refresh drops token after 401

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

Summary

Codex CLI works normally with ChatGPT authentication, but Codex Desktop on macOS enters a login loop whenever I open/select a conversation.

The Desktop app initially detects the authenticated ChatGPT account successfully. However, when a conversation is opened, a backend request returns HTTP 401. The Desktop then attempts to refresh authentication, but the auth state changes to:

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

After that, subsequent requests are sent without an access token and return 401, causing the Desktop app to ask me to log in again.

Relevant logs

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

Missing valid access token or actor biscuit

desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached

Earlier in the same run, the Desktop app successfully detected the authenticated account:

chatgpt-account-lookup ... authenticatedAccountPresent=true authMethod=chatgpt ... result=succeeded

The failure then occurs when opening/selecting a conversation.

Expected behavior

Codex Desktop should reuse or successfully refresh the valid ChatGPT authentication state, as Codex CLI does.

Actual behavior

Desktop starts normally and initially recognizes the authenticated account, but opening/selecting a conversation causes authentication to fail and the app asks me to log in again.

Troubleshooting already performed

  • Upgraded Codex CLI from an older version; CLI now works normally
  • Verified codex login status reports ChatGPT authentication
  • Verified ~/.codex/auth.json exists and has correct permissions
  • Reset Codex Desktop Application Support and cache
  • Reinstalled/updated Codex Desktop
  • Verified CODEX_HOME is not overridden
  • Verified no CODEX_ACCESS_TOKEN, OPENAI_API_KEY, OPENAI_BASE_URL, or related environment overrides exist
  • Issue still reproduces with a clean Desktop profile while CLI continues to work

Environment

  • macOS
  • ChatGPT authentication
  • Codex CLI: working normally
  • Codex Desktop: login loop when opening/selecting a conversation

Failure sequence

Desktop starts
  -> authenticated account is detected
  -> open/select a conversation
  -> request sent with token (`hadToken=true`)
  -> backend responds 401
  -> Desktop attempts refresh
  -> auth becomes `hasToken=false`, `auth_token_missing`, `refreshToken=true`
  -> subsequent requests are sent without a token
  -> login prompt appears again

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 7 days ago

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

  • #39684
  • #39162
  • #39581
  • #39695
  • #39716

Powered by Codex Action

TyceHerrman · 7 days ago
gwu929 · 3 days ago

Having exactly same issue after enabling advanced security as required by OpenAI by Sep 1st in order to stay compliant to retain access to "DayBreak Blue".

But as soon as advanced security is enabled, my MacOS codex desktop app (latest as of 8/24/2026) ended up in repeated authentication loop as soon as I click on an existing codex thread, note that authentication flow can complete normally in the advanced security flow using security key, the issue only surfaces when I try to click on a codex session.

Issue persists after clean reinstall which suggests the issue at openAI server end.

also, As soon as I disable advanced security, this issue is gone...

OpenAi pls fix this issue asap before Sep 1st, so that we can stay compliant as you requested, otherwise if I enable advanced security, my desktop codex turns un-usable because of the endless login loop.

Thanks.

ImadRashid · 3 days ago

I am having the exact same issue as soon as I login the codex app on MacOS. I click an old old it instantly logs out.

The issue persists after a clean reinstall as well.