Codex Desktop macOS: opening any session causes auth token loss and returns to Sign In after configuring Remote Connection
What version of the Codex App are you using (From “About Codex” dialog)?
Version 26.818.21641
What subscription do you have?
Plus
What platform is your computer?
macOS 26.6.1
Apple Silicon
64-bit
What issue are you seeing?
Since Aug 19, 2026, opening a Codex session causes Codex Desktop to immediately return to the ChatGPT Sign In screen.
Authentication initially succeeds and the session itself appears to load successfully. Logs show:
thread/read → errorCode=null
thread/resume → errorCode=null
maybe_resume_success
Immediately afterward, Desktop authentication fails:
desktop_fetch_auth_401 hadToken=true
authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
Subsequent requests then show:
desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
HTTP 401 Unauthorized
One request explicitly reports:
Unauthorized - Access token is missing
Signing in again succeeds, but opening a session immediately reproduces the same loop.
This appears to match the authentication regression reported in #39162, with closely related symptoms in #39581 and #39491.
What steps can reproduce the bug?
Launch Codex Desktop on macOS.
Sign into ChatGPT successfully.
Open an existing Codex session.
The thread begins loading/resuming successfully.
Desktop receives an authenticated 401 (hadToken=true).
Auth state changes to auth_token_missing / hasToken=false.
Subsequent requests are made with hadToken=false and return 401.
Desktop redirects to the ChatGPT Sign In screen.
Sign in again and open a session.
The same failure repeats.
I have reproduced this across multiple sessions.
What is the expected behavior?
Opening or resuming a Codex session should preserve the authenticated ChatGPT account state and load the session normally.
A failed authenticated request/token refresh should not cause Desktop to discard the available authentication state and subsequently issue requests without an access token.
Additional information
The issue first appeared immediately after I configured a Remote Connection on Aug 19.
I initially suspected Remote Control, but the problem persists after revoking all connections and disabling Remote Control entirely. I therefore cannot establish that Remote Connection caused the issue; it may only have coincided with or exposed the underlying authentication regression.
Troubleshooting completed:
Reinstalled Codex/ChatGPT Desktop — no change.
Signed out and performed fresh authentication — no change.
Tested multiple existing sessions — same behavior.
Revoked all Remote Connections — no change.
Disabled Remote Control entirely — no change.
Removed ~/.codex/auth.json and reauthenticated — no change.
Moved the entire ~/.codex directory aside and allowed Codex to generate completely fresh state — no change.
Removed the macOS Keychain Codex Safe Storage entry and performed fresh authentication — no change.
Fully restarted the application/processes — no change.
codex doctor reports databases healthy, config loaded, auth configured, WebSocket connected, and provider endpoints reachable.
The issue therefore reproduces with fresh Codex state and freshly initialized secure storage.
There is also a stale local workspace reference that generates an unrelated ENOENT/fs/readFile warning. However, thread/read, thread/resume, and maybe_resume_success complete before authentication collapses, so this does not appear to cause the Sign In loop.
The auth sequence appears particularly close to #39162:
authenticated
→ thread resume succeeds
→ hadToken=true
→ HTTP 401
→ auth_token_missing
→ hasToken=false
→ subsequent hadToken=false requests
→ Sign In
Related reports:
#39162 — macOS, near-identical auth sequence
#39581 — similar token/auth-state collapse
#39491 — similar behavior on Windows
Sanitized Desktop log containing the complete reproduction: codex-desktop-2026-08-20.log
6 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Independent reproduction on macOS with Codex Desktop 26.818.41705 (build 6971).
The app remains stable while idle. Opening any existing conversation is sufficient to trigger the failure; no message needs to be sent. The session initially resumes, then the Desktop logs show this sequence:
desktop_fetch_auth_401 hadToken=true→
refresh_token_invalidated / auth_token_missing→
authenticatedAccountPresent=false→ Desktop UI returns to Sign In
The main Desktop process remains alive, and Remote continues to work, so this is an interaction-triggered Desktop authentication loss rather than a full application crash.
Additional controls:
Has anyone found a working temporary mitigation or a fixed/test Desktop build? Reinstall, repeated sign-in, cache reset, and Chrome isolation have not resolved it.
I can consistently reproduce this on macOS.
A few additional observations that may help narrow the root cause:
In my case the behaviour is:
From the logs I consistently see the authentication transition beginning with entries such as:
desktop_fetch_auth_401followed by
auth_token_missingand then repeated HTTP 401 responses before the UI logs me out.
This feels less like an account configuration issue and more like a regression in the desktop authentication lifecycle. Advanced Account Security and Remote Connection should be fully supported features, not combinations that leave the client in an unrecoverable authentication loop.
If there are additional diagnostic flags or log categories that would help, I'm happy to provide sanitized logs.
Thanks — this is really helpful. Your Advanced Account Security + Remote Connection data point lines up closely with what I saw.
In my case, Remote kept working while the Desktop UI lost authentication, and the same logout still reproduced after Chrome/native-host consumers were fully isolated. That makes me think Remote may expose the broken path, but is probably not the root cause by itself.
I’ve rolled back to an older signed build and it is stable for now. I’m going to avoid more destructive resets and wait for either a confirmed fixed build or a reproducible account/workspace sign-in workaround. If you happen to test explicit Personal workspace selection or a different sign-in route, I’d be interested to hear whether it changes the behavior.
Independent reproduction here on macOS, with the same pattern described in this issue.
Environment
What happened
The problem began while I was setting up Remote access from my iPhone, around the same time I was required to change my ChatGPT password because the previous password had been reported as leaked. I completed normal MFA authentication. I was offered Advanced Account Security but did not enable it.
Desktop behavior is now consistently:
This loops indefinitely.
I have revoked Remote access from both the iPhone and desktop sides, fully quit/restarted the app, signed out/in again, and updated from 26.818.61809 to 26.820.60940. The problem persists.
Important control: the standalone Codex CLI on the same Mac and same ChatGPT account works normally.
codex login statusreturns:and this succeeds:
using
gpt-5.6-sol, returningOK.So the account, ChatGPT authentication, Codex entitlement, and model access are all working; the failure appears specific to the Desktop app session.
I also inspected cookie names only, not values, in:
~/Library/Application Support/Codex/Default/CookiesAfter successful desktop authentication I see the normal Cloudflare/device cookies for
chatgpt.com, but no__Secure-next-auth.session-token. This seems consistent with the desktop session/cookie failure being investigated in #40029.OpenAI Support has also now escalated my report to a support specialist.
The issue is currently 100% reproducible on 26.820.60940. Happy to provide any additional desktop logs or diagnostics that would help isolate it.
Update: login loop resolved for me so far
I was previously able to complete sign-in successfully, but opening a Codex thread would immediately return the desktop app to the sign-in state. Updating the app and repeatedly signing in did not resolve the problem.
I then tried the following sequence:
mv ~/.codex/auth.json ~/.codex/auth.json.before-desktop-reset
Environment:
So far, the result has remained stable through:
I cannot determine which step was decisive, so I would not characterize this as a confirmed root-cause fix. The potentially meaningful difference from my previous attempts was signing out of the browser session before moving aside the local Codex authentication file and completing a fresh desktop login.
I retained the old file as auth.json.before-desktop-reset and have not restored it.
I will update the issue if the login loop returns.