[macOS] Codex Desktop loses authentication (401 / auth_token_missing) and exits during conversations, while CLI and VS Code work normally
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.21641 (Build 6849)
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Darwin 25.1.0 arm64 arm
What issue are you seeing?
The Codex Desktop app on macOS launches and authenticates successfully, but after I start a Codex conversation it loses authentication and the app exits/restarts or returns to the login state.
The failure can happen while Codex is still thinking, so it is not specifically triggered by completion of a response. If I leave the Desktop app idle without starting a Codex conversation, it remains open.
The Desktop logs show the following sequence:
desktop_fetch_auth_401 hadToken=true
followed by:
hasToken=false
nullReason=auth_token_missing
refreshToken=true
and then repeated HTTP 401 errors such as:
Missing valid access token or actor biscuit
Unauthorized
The same ChatGPT account works normally with:
- Codex CLI installed through Homebrew (codex-cli 0.148.0)
- Codex in VS Code
- Browser ChatGPT
The CLI can run continuously and complete multiple conversations without logging out, so the problem appears to be specific to the Desktop app/authentication lifecycle.
Environment:
- macOS 26.1
- Apple Silicon / arm64
- Codex Desktop: 26.818.21641 (Build 6849)
- Desktop bundled Codex: codex-cli 0.148.0-alpha.21
- Homebrew Codex CLI: codex-cli 0.148.0
I have already tried reinstalling the Desktop app, restarting macOS, changing networks, rebuilding the Desktop profile/cache, re-authenticating, regenerating auth.json, resetting macOS permissions, and performing codex logout/login. The Desktop issue remains, while CLI and VS Code continue to work normally.
Important clarification: the Desktop failure started BEFORE I ran rm -rf ~/.codex. That command was only a later troubleshooting attempt to clear local authentication/cache state, so it was not the original cause of the problem.
What steps can reproduce the bug?
- Launch the Codex Desktop app on macOS.
- Sign in with my ChatGPT account. The login initially succeeds and the app shows the account as authenticated.
- Open Codex and create a new conversation.
- Send any normal prompt. For example:
"Hello, please briefly introduce yourself."
or a longer technical question.
- Codex starts processing the request normally. Sometimes it can return a complete response; sometimes the failure happens while the model is still thinking.
- After the Codex conversation has been active for a short period, the Desktop app unexpectedly exits/restarts or returns to the login state.
- After reproducing the issue, the Desktop logs show an authentication transition similar to:
desktop_fetch_auth_401 hadToken=true
followed by:
hasToken=false
nullReason=auth_token_missing
refreshToken=true
and then repeated HTTP 401 errors such as:
Missing valid access token or actor biscuit
Unauthorized
The problem is reproducible with different prompts and does not appear to depend on the prompt content.
Important control test:
- If I leave the Codex Desktop app open without starting a Codex conversation, it remains open normally.
- The same ChatGPT account works normally in the standalone Codex CLI and the VS Code Codex extension.
- The standalone CLI can remain active for several minutes and complete multiple conversations without losing authentication.
What is the expected behavior?
The Codex Desktop app should remain authenticated and continue running normally while a Codex conversation is active.
If the access token needs to be refreshed, the Desktop app should use the existing refresh token to refresh the authentication state instead of changing to auth_token_missing.
A background request returning HTTP 401 should not cause the Desktop application to exit/restart or return the user to the login state.
The expected behavior should be consistent with the Codex CLI and VS Code Codex extension, which currently work normally with the same ChatGPT account.
Additional information
Additional troubleshooting and environment information:
Environment:
- macOS 26.1 (Build 25B78)
- Apple Silicon / arm64
- Codex Desktop / ChatGPT Desktop: 26.818.21641 (Build 6849)
- Desktop bundled Codex: codex-cli 0.148.0-alpha.21
- Standalone Homebrew Codex CLI: codex-cli 0.148.0
- Standalone CLI path: /opt/homebrew/bin/codex
Control tests:
- Standalone Codex CLI works normally with the same account.
- VS Code Codex extension works normally with the same account.
- Browser ChatGPT works normally.
- Codex CLI logout -> login succeeds.
- CLI can complete multiple conversations without being logged out.
Troubleshooting already performed without resolving the Desktop issue:
- Reinstalled the Desktop app.
- Restarted macOS.
- Tested using a different network/mobile hotspot.
- Re-authenticated the ChatGPT account.
- Regenerated ~/.codex/auth.json.
- Rebuilt the Desktop Electron/Chromium profile.
- Rebuilt Codex-related WebKit/HTTPStorage/cache data.
- Reset macOS Automation, Accessibility and Screen Recording permissions.
- Verified that the newly issued access token was not expired.
- Verified that the account ID used by Desktop matched the newly generated authentication state.
- Performed Codex CLI logout -> login successfully.
The Desktop logs also sometimes contain Computer Use/CUA errors, including:
CUAService bootstrap failed
Codex Computer Use Apple Event error -1743
However, resetting macOS permissions did not resolve the issue, and the main reproducible failure remains the authentication sequence:
hadToken=true
-> HTTP 401
-> hasToken=false
-> auth_token_missing
-> repeated HTTP 401 responses
Important timeline clarification:
Before the problem started I was troubleshooting the third-party Hatch Pet Codex skill because load_workspace_dependencies was unavailable. I updated the separately installed Homebrew Codex CLI during that troubleshooting.
The Desktop problem started BEFORE I ran:
rm -rf ~/.codex
That command was only a later troubleshooting attempt suggested to clear local authentication/cache state, so it was not the original cause of the Desktop failure.
Also, the Homebrew CLI and the Desktop bundled Codex are different binaries:
Homebrew:
/opt/homebrew/bin/codex
codex-cli 0.148.0
Desktop:
/Applications/ChatGPT.app/Contents/Resources/codex
codex-cli 0.148.0-alpha.21
The Homebrew CLI currently works normally, while only the Desktop app fails.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I’m seeing what appears to be the same issue on the latest ChatGPT Mac app.
Version: ChatGPT 26.818.32112
Repro for me:
The same OpenAI account stays signed in and works normally in Chrome at the same time, so this appears isolated to the Mac desktop app/session rather than my account generally.
I’m on the newest/latest updated ChatGPT app available to me. Happy to provide additional diagnostics if useful.
Seeing this for 26.818.61809 (7019) - latest version as well. Can't use Codex at all. How is this not a P0!