You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Desktop app (macOS): logged out after every conversation — "Missing valid access token or actor biscuit", no token refresh attempted #40395
codex-cli 0.148.0-alpha.21 (same machine, same account)
ChatGPT Plus subscription, ChatGPT-account OAuth login
Network note: system HTTP(S) proxy in use; the codex CLI on the same machine/network works flawlessly for days with zero logouts (relevant control group)
Symptom
The desktop app logs me out after almost every conversation. Finishing a chat, or clicking any history conversation, kicks me back to the sign-in screen. Re-login succeeds but the cycle repeats. ~100% reproducible.
sa_server_request_failed attachAuth=true attachIntegrityState=true
errorMessage="Missing valid access token or actor biscuit"
All subsequent backend-api requests degrade to hadToken=false skipRetryReason=no_token_attached and retry ~1/min indefinitely.
After access-token expiry (~1h), no refresh attempt is ever made — auth.json stays untouched (verified with a file watcher).
On a previous occasion the app also logged Failed to refresh token: 401 ... "Your refresh token has been invalidated" (code token_revoked) during a concurrent re-login — but the current failures occur with a fresh, exclusive token.
Already ruled out
Full data reset: quit app; archived ~/Library/Application Support/Codex, ~/Library/HTTPStorages/com.openai.codex* (incl. binarycookies), ~/Library/Caches/com.openai.codex, the notifications Group Container, and Preferences; fresh start + fresh device login → same 401 within minutes of the first conversation.
Keychain: login keychain is writable (other Chromium-based apps maintain their "Safe Storage" entries fine), but this app never creates one; secd logs show zero denials — the app simply never writes.
Token conflicts: ensured no other process shares the app's auth.json; the failure reproduces with an exclusive, freshly-issued token.
Reinstall-equivalent (clean profile) does not help; app reports it is up to date.
Question
What causes actor-biscuit issuance/validation to fail persistently for this device? Is it tied to device registration or network/TLS fingerprint (proxy)? The CLI's auth on the same account/machine/network is rock-solid, so this appears specific to the desktop app's web-session path. Happy to provide full logs privately.
Workaround that fixed the older-task logout loop for me
I had the same issue: new tasks worked, but opening an older codex://threads/... task immediately logged me out.
What I verified
I reproduced and investigated this across four different older tasks:
The older tasks and their local transcripts were still intact.
The local task database passed its integrity checks.
The codex:// handler was registered correctly.
The app successfully resumed the task first: thread/resume returned errorCode=null.
Immediately afterward, authentication failed with 401 Unauthorized and refresh_token_invalidated.
This suggests the logout was caused by stale or invalid desktop authentication—not corrupted older tasks.
What fixed it for me
Open chatgpt.com in your browser.
Open the profile menu and fully Log out, then confirm.
Be aware that this can also sign you out of other ChatGPT sessions.
Return to the Codex/ChatGPT Mac app.
Click Sign in another way.
Choose Email and sign in directly using the email address connected to your ChatGPT account. Do not use Google, Apple, or another social-login option.
Enter the email verification code if requested.
On the Sign in to Codex with ChatGPT page, explicitly select the workspace containing the affected older tasks. In my case, this was Personal account. My personal and company workspace both use the same email address.
Click Continue/Open ChatGPT, return to the desktop app, and try opening the older tasks again.
After the full browser logout and direct email sign-in, I successfully opened all four older tasks without being logged out. The task resumes continued to return errorCode=null, with no further refresh_token_invalidated errors while opening them.
The successful test happened on the same ChatGPT/Codex build that had previously failed. I had staged a reinstall, but the logs confirmed the app was still running from the older copy, so I do not consider reinstalling or renaming the app to be the fix.
I did not delete ~/.codex, its session files, or its SQLite databases. Those contained healthy local task history, and deleting them could cause data loss.
Environment:
macOS 27 beta (26A5421a)
ChatGPT/Codex 26.818.61809, build 7019
Btw I also have advanced security on so that shouldn't be the issue
I still observed a separate account-settings 401 saying Must use workspace account for this operation, but it no longer logged me out or prevented older tasks from opening. Therefore, this should be considered a workaround rather than a confirmed root-cause fix.
Workaround that fixed the older-task logout loop for me
I had the same issue: new tasks worked, but opening an older codex://threads/... task immediately logged me out.
What I verified
I reproduced and investigated this across four different older tasks:
The older tasks and their local transcripts were still intact.
The local task database passed its integrity checks.
The codex:// handler was registered correctly.
The app successfully resumed the task first: thread/resume returned errorCode=null.
Immediately afterward, authentication failed with 401 Unauthorized and refresh_token_invalidated.
This suggests the logout was caused by stale or invalid desktop authentication—not corrupted older tasks.
What fixed it for me
Open chatgpt.com in your browser.
Open the profile menu and fully Log out, then confirm.
Be aware that this can also sign you out of other ChatGPT sessions.
Return to the Codex/ChatGPT Mac app.
Click Sign in another way.
Choose Email and sign in directly using the email address connected to your ChatGPT account. Do not use Google, Apple, or another social-login option.
Enter the email verification code if requested.
On the Sign in to Codex with ChatGPT page, explicitly select the workspace containing the affected older tasks. In my case, this was Personal account. My personal and company workspace both use the same email address.
Click Continue/Open ChatGPT, return to the desktop app, and try opening the older tasks again.
After the full browser logout and direct email sign-in, I successfully opened all four older tasks without being logged out. The task resumes continued to return errorCode=null, with no further refresh_token_invalidated errors while opening them.
The successful test happened on the same ChatGPT/Codex build that had previously failed. I had staged a reinstall, but the logs confirmed the app was still running from the older copy, so I do not consider reinstalling or renaming the app to be the fix.
I did not delete ~/.codex, its session files, or its SQLite databases. Those contained healthy local task history, and deleting them could cause data loss.
Environment:
macOS 27 beta (26A5421a)
ChatGPT/Codex 26.818.61809, build 7019
Btw I also have advanced security on so that shouldn't be the issue
I still observed a separate account-settings 401 saying Must use workspace account for this operation, but it no longer logged me out or prevented older tasks from opening. Therefore, this should be considered a workaround rather than a confirmed root-cause fix.
log out the web chatgpt and relogin definitely solved my problem! Thanks!
Activity
github-actions commentedon Aug 24, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
janneman86 commentedon Aug 25, 2026
Workaround that fixed the older-task logout loop for me
I had the same issue: new tasks worked, but opening an older
codex://threads/...task immediately logged me out.What I verified
I reproduced and investigated this across four different older tasks:
codex://handler was registered correctly.thread/resumereturnederrorCode=null.401 Unauthorizedandrefresh_token_invalidated.This suggests the logout was caused by stale or invalid desktop authentication—not corrupted older tasks.
What fixed it for me
chatgpt.comin your browser.Be aware that this can also sign you out of other ChatGPT sessions.
After the full browser logout and direct email sign-in, I successfully opened all four older tasks without being logged out. The task resumes continued to return
errorCode=null, with no furtherrefresh_token_invalidatederrors while opening them.The successful test happened on the same ChatGPT/Codex build that had previously failed. I had staged a reinstall, but the logs confirmed the app was still running from the older copy, so I do not consider reinstalling or renaming the app to be the fix.
I did not delete
~/.codex, its session files, or its SQLite databases. Those contained healthy local task history, and deleting them could cause data loss.Environment:
26A5421a)26.818.61809, build7019Btw I also have advanced security on so that shouldn't be the issue
I still observed a separate account-settings
401sayingMust use workspace account for this operation, but it no longer logged me out or prevented older tasks from opening. Therefore, this should be considered a workaround rather than a confirmed root-cause fix.wrencanfly commentedon Aug 25, 2026
log out the web chatgpt and relogin definitely solved my problem! Thanks!