Codex Desktop repeatedly signs out on macOS while CLI and web remain authenticated
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of the Codex App are you using (From “About Codex” dialog)?
ChatGPT Desktop bundled Codex: codex-cli 0.149.0-alpha.4.3 I also tested standalone Codex CLI versions: 0.149.1 — works normally 0.148.0 — works normally
What subscription do you have?
ChatGPT Prolite
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
What issue are you seeing?
ChatGPT/Codex Desktop on macOS repeatedly signs me out during normal use.
This issue appears to be specific to the Desktop app. ChatGPT web stays signed in and works normally, and standalone Codex CLI also remains authenticated and works normally with the same account.
Sometimes after the Desktop app signs me out, quitting and reopening the app restores the session automatically. However, the sign-out issue keeps recurring.
Relevant Desktop logs show:
Unauthorized - Access token is missing
desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
Example log entries:
status=401
errorMessage="Unauthorized - Access token is missing"
tokenSource=cached
willRetry=false
I have already tested the following:
- Reinstalled and updated ChatGPT Desktop.
- Confirmed ChatGPT web remains signed in.
- Confirmed Advanced Account Security is not enabled.
- Checked macOS Keychain; no relevant Codex credential issue was found.
- Confirmed
~/.codex/auth.jsonexists and is updated after authentication. - Reset Desktop cache/profile data.
- Tested standalone Codex CLI
0.149.1— stable. - Tested standalone Codex CLI
0.148.0— stable. - Temporarily tested the Desktop app with the
0.148.0Codex binary — Desktop still signed out. - Restored the original ChatGPT app and verified the app code signature is valid.
Current behavior:
The Desktop app eventually behaves as if no access token is attached and starts returning HTTP 401 errors, even though the same account remains authenticated in ChatGPT web and Codex CLI.
Expected behavior:
The Desktop app should remain authenticated continuously, like ChatGPT web and standalone Codex CLI.
Additional diagnostic information was uploaded via /feedback.
Uploaded thread ID:
01a03cb1-2fb8-7603-8e9b-7cd01c7740ac
What steps can reproduce the bug?
Steps to reproduce
- Open the ChatGPT Desktop app on macOS.
- Enter Codex and sign in successfully.
- Start or open a Codex thread.
- Use Codex normally for a few minutes.
- The Desktop app eventually loses authentication and behaves as if the user has been signed out.
- Relevant requests then begin returning HTTP 401 errors.
- Quitting and reopening the Desktop app may restore the login session automatically, but the issue recurs again after continued use.
The issue reproduces without any specific prompt or code snippet.
It also reproduces after:
- reinstalling/updating ChatGPT Desktop
- resetting the Desktop cache/profile
- confirming
~/.codex/auth.jsonexists and is updated - testing with a different bundled Codex binary version
Control tests:
- ChatGPT web remains signed in and works normally with the same account.
- Standalone Codex CLI
0.149.1remains authenticated and works normally. - Standalone Codex CLI
0.148.0also remains authenticated and works normally.
Relevant log messages include:
Unauthorized - Access token is missing
desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
Uploaded diagnostic thread ID:
01a03cb1-2fb8-7603-8e9b-7cd01c7740ac
Session ID / token usage / context window usage:
Not applicable. The issue appears to be authentication/session related rather than prompt-length or context-window related.
What is the expected behavior?
Expected behavior
ChatGPT/Codex Desktop should remain authenticated continuously after a successful sign-in.
Using Codex normally, opening threads, or leaving the app running should not cause the Desktop app to lose its authentication state or return to the signed-out screen.
Requests from the Desktop app should continue attaching a valid access token and should not fail with HTTP 401 errors during normal use.
The Desktop authentication behavior should be consistent with ChatGPT web and standalone Codex CLI, which remain signed in and work normally with the same account.
Additional information
Additional information
A few additional observations may help with diagnosis:
- After the Desktop app signs out, quitting and reopening the app sometimes restores the session automatically without requiring me to sign in again.
- This suggests that persistent credentials may still be valid while the Desktop runtime authentication state is being lost.
~/.codex/auth.jsonremains present and is updated after authentication.- The issue persists even after resetting the Desktop cache/profile.
- The issue also persisted when I temporarily tested the Desktop app with a
0.148.0Codex binary. - Standalone Codex CLI remains stable with the same account, while the Desktop app repeatedly loses authentication.
- ChatGPT web also remains signed in throughout.
This makes the issue appear specific to the Desktop authentication/token attachment layer rather than an account-level authentication failure.
Diagnostic information was uploaded via /feedback.
Uploaded thread ID:
01a03cb1-2fb8-7603-8e9b-7cd01c7740ac
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the sign-out flow in the macOS Desktop app and reviewing the reported Unauthorized - Access token is missing, desktop_fetch_auth_401, hadToken=false, and skipRetryReason=no_token_attached logs. Compare the Desktop runtime behavior with the persistent ~/.codex/auth.json state and the stable standalone CLI behavior. Done means the Desktop app remains authenticated during normal use and requests no longer fail with HTTP 401 errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, rust
- Domain
- authentication, desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100