Codex App: infinite sign-in loop — app never receives a chatgpt.com session cookie, so backend-api calls 401 ("Missing valid access token or actor biscuit")
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.31338 (also reproduced on 26.818.22352); Codex Framework 151.0.7922.170
What subscription do you have?
ChatGPT Pro
What platform is your computer?
Darwin 25.6.0 arm64 arm (macOS 26.6.1, build 25G76, Apple M2 Max)
What issue are you seeing?
The app launches signed-in and renders the full UI (sidebar, pinned chats, projects, account). Opening ANY thread immediately returns to the "Sign in to ChatGPT" screen. Signing in again succeeds in the browser, and the loop repeats. Started ~2026-08-18. The Codex CLI is completely unaffected and works normally on the same machine and account.
Root cause (evidence below): the app never obtains a chatgpt.com web session cookie.
Server response on the app's UI calls:
{"detail":"Missing valid access token or actor biscuit"}
App log then discards its own token:
desktop_fetch_auth_401 hadToken=true target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
sa_server_request_failed status=401 errorMessage={"detail":"Unauthorized"}
app_server_connection.auth_status_result hasToken=false nullReason=auth_token_missing tokenExpiryState=missing
-> all subsequent calls: hadToken=false skipRetryReason=no_token_attached -> 401
Failing routes are all chatgpt.com web backend-api, never the Codex API:/accounts/{id}/settings, /accounts/optimized/check, /wham/onboarding/context, /wham/usage, /wham/tasks/list, /aip/first-party/eligibility, /amphora/notifications, /beacons/home, /sentinel/heartbeat
Cookie-jar evidence (decisive). Immediately after a fully successful OAuth sign-in:
Chrome's jar — 31 chatgpt.com cookies including a valid session:
__Secure-next-auth.session-token expires 2026-11-19
__Secure-oai-is expires 2026-09-20
cf_clearance, _puid, __obref, ...
The app's jar (~/Library/Application Support/Codex/Default/Cookies) — 5 cookies, no session at all:
__cf_bm, __cflb, __oailb, _cfuvid, _devicecheck
There is no __Secure-next-auth.session-token in the app's jar under any condition. The OAuth completes in the external browser and the resulting web session is deposited in the browser's jar, never the app's.
Token evidence. auth.json after a fresh sign-in is complete and valid, but scoped to the Codex API rather than chatgpt.com:
aud: ["https://api.openai.com/v1"]
scp: ["openid","profile","email","offline_access","api.connectors.read","api.connectors.invoke"]
client_id: app_EMoamEEZ73f0CkXaXp7hrann
That same auth.json authenticates the CLI successfully (codex exec returns normally) seconds after the app is rejected. So the credential is valid — it simply carries no authority for chatgpt.com/backend-api/*, and the flow never provisions the session that endpoint requires.
What steps can reproduce the bug?
- Launch the Codex app on macOS 26.6.1. It renders signed-in.
- Click any thread in the sidebar.
- App returns to the "Sign in to ChatGPT" screen.
- Click "Continue to sign in" -> browser opens -> consent page -> Continue.
The localhost callback on 127.0.0.1:1455 is consumed and a fresh valid auth.json is written.
- App shows the signed-in UI again. Open any thread -> back to step 3. Loops indefinitely.
Inspect the app's cookie jar at any point:
sqlite3 "$HOME/Library/Application Support/Codex/Default/Cookies" \
"select host_key,name from cookies where host_key like '%chatgpt%';"
Result is always the same 5 non-session cookies; __Secure-next-auth.session-token never appears.
Things tried that do NOT fix it (all verified, all leave the jar without a session cookie)
- Completing the in-app sign-in end to end (callback consumed, fresh token written).
- The
chatgpt.com/codex/open-app?source=login&app_brand=chatgpthandoff page ("You're signed in and may close this tab") — clicked its "Open ChatGPT" button. - Deep-linking that same handoff URL into the app's own webview via
open -b com.openai.codex "<url>"(the app declareshttp/httpshandlers). - A completely fresh Chromium profile for the app.
- Updating from 26.818.22352 to the latest 26.818.31338.
- Deleting the keychain item "Codex Safe Storage" and clearing the cookie jar so the app regenerates its encryption key (rules out "app cannot decrypt its own jar"; note a fresh profile does NOT cover this, since it reuses the same keychain key).
- Removing
~/.codex/auth.jsonentirely and letting the app run its own sign-in from scratch — it re-mints the identicalclient_id/aud: https://api.openai.com/v1/ same scopes, and still gets no session cookie. This confirms the token above is the app's own OAuth registration, not borrowed CLI state. - "Sign in another way" only offers an OpenAI API key, which is not applicable to a ChatGPT-plan user.
Ruled out (tested, not assumed)
- Account/subscription: Pro, active, single org, owner. CLI works on the same credential.
- Bundle integrity:
codesign -vvalid and notarized, satisfies its Designated Requirement. - Keychain: item present and regenerable (see 6).
- Network interference:
/etc/hostsclean, no VPN or proxy configured, Malwarebytes engine active but with zero block verdicts inRTProtectionDaemon.log(only unrelated June/July file-read warnings). - Pending device/security verification: no email from OpenAI in the preceding 10 days.
- Stale LaunchServices registrations claiming
codex:— moot, since the callback is an HTTP listener on 127.0.0.1:1455, andopen codex://resolves to the correct app. - An oversized local thread (a 2.1 GB rollout existed and was archived); small healthy threads fail identically.
What is the expected behavior?
Completing the sign-in flow should leave the app able to open threads and stay signed in.
Concretely, one of the following needs to hold:
- the external-browser sign-in deposits the chatgpt.com session into the app's cookie jar (not only the default browser's), or
- the app performs sign-in inside its own browser context so the session lands there natively, or
- the token the app is issued (
aud: https://api.openai.com/v1) is accepted by thechatgpt.com/backend-api/*endpoints the app's UI depends on.
Today none of the three holds, so the app is unusable on this machine while the CLI works fine.
Additional information
An OpenAI Support case is already open for this: Case 13489309 (2026-08-20). The steps suggested there were reinstalling, disabling VPN/proxy/secure DNS/antivirus web protection, and confirming the original auth method — the network-related ones have since been verified as non-factors (no VPN or proxy configured, /etc/hosts clean, Malwarebytes shows zero block verdicts), and reinstall-grade state resets are covered in the list above.
Two useful diagnostics for anyone triaging this:
# app's cookie jar — should contain a session cookie after sign-in, but never does
sqlite3 "$HOME/Library/Application Support/Codex/Default/Cookies" \
"select host_key,name from cookies where host_key like '%chatgpt%';"
# launch with logging to see the 401 -> token-discard sequence
/Applications/ChatGPT.app/Contents/MacOS/ChatGPT --enable-logging=stderr --v=1 2>&1 \
| grep -E "desktop_fetch_auth_401|auth_status_result|actor biscuit"
Unrelated but worth flagging for others: unregistering Sparkle's Updater.app from LaunchServices will silently stall the app's own updater at "Extracting update…". Re-registering it with lsregister -f on ~/Library/Caches/com.openai.codex/org.sparkle-project.Sparkle/Launcher/*/Updater.app restores updating.
All identifiers (account id, user id, org id, email, device serial) have been redacted from this report.
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Correction from the reporter: my root-cause claim was wrong — this is a duplicate of #39162
I'm correcting my own report rather than leaving an inaccurate diagnosis in the tracker.
What I got wrong. I titled this "app never receives a chatgpt.com session cookie." The missing session cookie is real and reproducible, but it is a symptom, not the cause. I inferred causation from a cookie-jar diff without capturing the failing response body.
Actual root cause, established by @rishirsv in #39162, who captured the exact backend response:
The renderer (build >= 6720) calls a workspace-only settings route for personal accounts. The backend correctly rejects it as a route-scoped authorization failure, and the client escalates that into global authentication loss — discarding a still-valid token and dropping to sign-in. Trigger is
thread/resume, ~2.6s after opening an existing conversation. My jar observation follows from the token discard, not the other way round.Confirming the rollback fix on a third machine. Same-machine A/B, matching @mattdorman's and @AryanRG's results:
| | |
|---|---|
| Failing |
26.818.31338(build 6892) || Working |
26.810.52044(build 6662) || Hardware | Apple M2 Max, macOS 26.6.1 (25G76), arm64 |
| Account | personal ChatGPT Pro, no workspace/MDM |
This Mac left 6662 via Sparkle auto-update at
2026-08-19T00:22:49Z, and the loop began immediately after — the log timeline matches the user-reported onset exactly.Instrumented result after rolling back to 6662, opening three separate pre-existing threads:
I'm reporting the resume count deliberately: a zero-delta with zero resumes would be a false negative. 8 resumes with 0 auth failures is a real one.
Package verification (independent of any link in this thread — the Apple chain is what establishes trust):
One operational note for anyone rolling back:
SUEnableAutomaticChecksandSUAutomaticallyUpdatewere both1on my install, so Sparkle will silently re-apply a broken build. Setting both to0is necessary to make a rollback stick — though the log also showsbackendAppcastEnabled=true, so the appcast is server-driven and the pinning may not be authoritative. Worth re-checking the build after a restart.Happy for maintainers to close this as a duplicate of #39162. The corrected fix request is the one already stated there: do not escalate a route-scoped 401 into global auth invalidation, and gate the settings route on a confirmed workspace account.
Confirming the same issue on Linux Mint 22.3 (amd64) with the official OpenAI Linux DEB.
Current build: 26.818.61809
Also reproduced after downgrading to:
26.818.41705
26.818.41509
Browser authentication succeeds and the desktop app initially shows the correct ChatGPT Plus account and conversation list. Opening an existing conversation then causes the app to return to the sign-in screen.
The bundled CLI still reports:
Logged in using ChatGPT
The desktop Sentry log repeatedly showed:
desktop_fetch_auth_401 hadToken=false skipRetryReason=no_token_attached tokenSource=cached willRetry=false
with 401 Unauthorized responses from endpoints including:
https://chatgpt.com/backend-api/wham/usage
and:
https://chatgpt.com/backend-api/wham/tasks/list
I moved ~/.codex/auth.json aside and performed a completely fresh browser login. This did not resolve the desktop problem.
I also inspected the desktop Chromium cookie database (cookie names only). It contains Cloudflare/load-balancer cookies and _puid / oai-sc, but no apparent ChatGPT session cookie such as __Secure-next-auth.session-token.
The same account works normally in Firefox and Brave. This therefore appears confined to the Linux desktop application's authentication/session handling.
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.