Skip to content

[macOS][26.814.41407] Opening an existing conversation invalidates ChatGPT auth and redirects to sign-in #39162

Open

Description

@gaozhitw

What version of the Codex App are you using?

26.814.41407 (build 6720), macOS arm64 production build.

The last known-good version on the same machine is 26.810.52044 (build 6662).

What subscription do you have?

ChatGPT account authentication. Exact tier omitted because the failure is in the desktop authentication bridge and reproduces before any model request.

What platform is your computer?

  • MacBook Pro (Mac16,8)
  • Apple M4 Pro
  • macOS 26.5.2 (25F84)
  • arm64

What issue are you seeing?

Immediately after the automatic update to 26.814.41407, opening any existing conversation redirects the desktop app to the "Log in to ChatGPT" screen.

At launch, the app initially appears authenticated and shows the conversation list. Selecting an existing conversation successfully resumes the local thread, but within about 400 ms the desktop shell receives HTTP 401 from the ChatGPT account settings endpoint. The app then reports that the auth token is missing, changes the account state to unauthenticated, and displays the login screen.

Quitting and reopening the app temporarily shows the authenticated UI again. Selecting an existing conversation immediately repeats the failure.

Manually signing out also produced a full-screen "Oops, an error has occurred" page.

Sanitized log sequence from 26.814.41407:

chatgpt-account-lookup ... authenticatedAccountPresent=true authMethod=chatgpt result=succeeded
AppServerConnection ... method=thread/resume ... errorCode=null
electron-fetch-wrapper ... desktop_fetch_auth_401 hadToken=true ... /accounts/:param/settings ... willRetry=true
AppServerConnection ... authMethod=chatgpt hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing
chatgpt-account-lookup ... authenticatedAccountPresent=false failureType=account_info_token_unavailable result=failed
electron-message-handler ... status=401 ... Missing valid access token or actor biscuit
electron-message-handler ... status=401 ... Unauthorized

No account IDs, conversation IDs, token values, or local paths are included above.

What steps can reproduce the bug?

  1. Be signed into ChatGPT in Codex/ChatGPT Desktop on macOS.
  2. Update the desktop app from 26.810.52044 (build 6662) to 26.814.41407 (build 6720).
  3. Launch the app. It initially appears signed in and lists existing conversations.
  4. Select any existing conversation.
  5. Observe that the thread resumes locally, then the app immediately redirects to the ChatGPT login screen.
  6. Quit and relaunch the app. It appears signed in again until an existing conversation is selected, after which the same redirect occurs.

What is the expected behavior?

Opening an existing conversation should preserve the authenticated account state and load the conversation normally.

Additional information

Troubleshooting completed:

  • Disabled and fully quit AdGuard: no change.
  • Quit and relaunched the desktop app repeatedly: no change.
  • Signed out and performed a fresh ChatGPT device authorization: login succeeded, but selecting an existing conversation still triggered the same 401 and auth_token_missing sequence.
  • Cleared and rebuilt the Electron cookies, local storage, and session storage after making backups: no change.
  • Verified the bundled CLI reports ChatGPT authentication configured and provider/WebSocket reachability healthy.
  • Tested both the bundled app-server and stable Codex CLI 0.147.0: no change.
  • Rolled back only the desktop app to the official signed and notarized 26.810.52044 build while preserving the same account, local thread data, and network environment.

Rollback result:

  • Existing conversations resumed successfully.
  • The authenticated account remained present.
  • The desktop_fetch_auth_401 and auth_token_missing events disappeared.
  • The app became usable immediately without changing AdGuard, account, or network configuration.

This makes the regression strongly specific to desktop build 26.814.41407 rather than the account, local conversation data, or network path.

Related but not identical reports:

User feedback: Linux Mint shows the same sign-in loop when opening chats

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    authIssues related to authentication and accounts
    on Aug 18, 2026
  2. kent8192 commented on Aug 18, 2026

    @kent8192

    Confirming this reproduction on another machine (macOS arm64).

    • App: ChatGPT desktop (bundle id com.openai.codex), version 26.814.41407 (build 6720), Apple Silicon
    • Auth: ChatGPT account (auth_mode = chatgpt)

    Observed (matches this issue's log sequence exactly): at launch the app appears signed in and lists conversations; selecting an existing conversation resumes the thread, then within ~2s:

    • desktop_fetch_auth_401 hadToken=true … /accounts/:param/settings … willRetry=true
    • sa_server_request_failed … "Missing valid access token or actor biscuit" … /accounts/{account_id}/settings … status=401
    • getAuthStatus … hasToken=false nullReason=auth_token_missing

    After that the app drops the cached token (hadToken=false skipRetryReason=no_token_attached) and /wham/tasks/list returns 401 every ~60s, driving the sign-in redirect loop.

    Already attempted (no fix): deleted/regenerated ~/.codex/auth.json and did a fresh device login — OAuth refresh now succeeds (refresh_token_invalidated no longer appears), but the settings-endpoint 401 and loop still recur.

    Workaround: rolling back to 26.810.52044 (build 6662); will report back whether it clears the loop here too.

  3. AndreRobitaille commented on Aug 18, 2026

    @AndreRobitaille

    Same problem here. Same platform.

  4. mattdorman commented on Aug 19, 2026

    @mattdorman

    Confirming here as well, with an OS data point: this also reproduces on the macOS 27.0 developer beta (build 26A5416b), Apple Silicon (arm64) — so it doesn't appear specific to any one macOS release; the app build is the common factor.

    • App 26.814.41407 (build 6720), auto-updated 2026-08-18 13:03Z. First desktop_fetch_auth_401 appears 16 minutes later (13:19:56Z) — hadToken=true on /accounts/:param/settings, then hadToken=false skipRetryReason=no_token_attached tokenSource=cached for everything after, same sequence @kent8192 posted above.
    • Marker counts in ~/Library/Logs/com.openai.codex/: 0 occurrences across Aug 5–17 logs, 196 since the update.
    • account_login_completed logged 30 times since the update — sign-ins via passkey and hardware security key both complete every time, but the token never reaches the fetch layer, so the next /backend-api/wham/tasks/list call 401s and the sign-in sheet reappears.
    • No effect from: full reset, repeated re-login, app/OS restarts. Keychain (Codex Safe Storage) and cookie stores verified intact. codex CLI on the same machine is unaffected — ~/.codex/auth.json refreshes normally (it was last refreshed by the desktop app mid-loop, so OAuth itself is healthy).

    Happy to provide fuller logs if useful.

  5. excessbaggage commented on Aug 19, 2026

    @excessbaggage

    same issue. Macbook air m5

  6. nengong commented on Aug 19, 2026

    @nengong

    Another reproduction on macOS 26.6 / M1 Max, sanitized logs below.
    [macOS][26.814.41407] Sign-in loop after update: fresh OAuth token rejected (actor biscuit 401)

    Environment: Codex desktop 26.814.41407 (build 6720), updated from 26.810.52044 on Aug 19 ~11:54 local; macOS 26.6 (25G72), M1 Max; ChatGPT account auth.

    Summary: Since the update, the app loops: OAuth completes, chat UI shows ~2 s, then bounces back to sign-in, indefinitely. Same account/network/config worked before.

    Reproduce: Update to 26.814.41407 → ChatGPT sign-in succeeds → chat UI appears, previous conversation restores → within ~2 s back to the login screen.

    Log sequence (~/Library/Logs/com.openai.codex/2026/08/19, UTC; app refreshed auth.json at 04:01:45, so OAuth itself is healthy):

    04:01:45  account_login_completed success=true
    04:01:50  existing conversation restored
    04:01:52  desktop_fetch_auth_401 hadToken=true GET chatgpt.com/backend-api/accounts/:param/settings
    04:01:53  sa_server_request_failed {"detail":"Missing valid access token or actor biscuit"}
    04:01:53  auth_status_result hasToken=false nullReason=auth_token_missing
    04:01:55  desktop_fetch_auth_401 hadToken=false no_token_attached GET .../wham/:param/:param
    04:02:48  same on /wham/tasks/list; recurs ~every 60 s → sign-in screen
    

    The fresh token never reaches backend-api requests, so the app treats the session as unauthenticated.

    Timeline (local logs): Aug 17 and Aug 19 morning on 26.810.52044: app fully working, zero auth errors in logs. Updated to 26.814.41407 on Aug 19 ~11:54 local → hard loop within seconds: 8× actor-biscuit, 8× auth_token_missing in ~10 min.

    Tried (no effect): 3 web re-authorizations (each completes); 6 restarts; reinstall from newly downloaded DMG (same build).

    Refs: identical to #39162 (same build/logs, multiple confirmations); related #38482.

    Request: prioritize a patch for build 6720's auth bridge, or advise a workaround other than rollback to 26.810.52044.

  7. chunguscodes commented on Aug 19, 2026

    @chunguscodes

    I am now also experiencing this issue.

  8. gaozhitw commented on Aug 19, 2026

    @gaozhitw
    Author

    I found a workaround that resolved the issue for me:

    1. Sign out of the older Codex desktop app.
    2. In ChatGPT Web, sign out all currently registered Codex devices.
    3. Sign out of ChatGPT Web as well.
    4. Update the Codex desktop app to the latest available version.
    5. Sign in again.

    After completing these steps, I can open any existing conversation without being signed out again.

    This may help anyone encountering the same problem. It appears that fully clearing the existing device and web sessions before signing in with the updated app is the important part, although I have not confirmed the underlying root cause.

  9. JiaruiUNSW commented on Aug 19, 2026

    @JiaruiUNSW

    Additional root-cause isolation: personal paid plan is enabling a workspace-only settings query

    I reproduced this independently on macOS arm64 with a personal ChatGPT Pro account and compared the shipped renderer bundles from a failing and a working signed build.

    Affected / control builds

    • Reproduced on desktop 26.814.41407 (build 6720) and 26.814.41957 (build 6744).
    • Not reproduced after rollback to signed desktop 26.727.51351 (build 6119).
    • Switching only the app-server/CLI to stable 0.148.0 did not change the failure, which points to the desktop renderer/auth bridge rather than thread data or Codex core.

    Endpoint and token comparison

    Immediately before the logout, the same fresh bearer token produced:

    GET /backend-api/wham/usage
    -> 200 OK (personal plan_type: pro)
    
    GET /backend-api/accounts/<personal-account>/settings
    -> 401 {"detail":"Must use workspace account for this operation"}
    

    The selected historical thread had already completed thread/resume successfully. The settings 401 was then handled by the generic authenticated-fetch retry path, followed by a forced auth refresh; the observed state sequence ended in refresh_token_invalidated / auth_token_missing, hasToken=false, and the sign-in UI.

    This means the historical session files are not the source of the failure. A resource-authorization 401 from a workspace-only endpoint is being escalated into global authentication loss.

    Shipped renderer A/B

    In the failing renderer, the usage banner mounts a hook that requests /accounts/{account_id}/settings and selects usage_limit_increase_request. For a non-owner/non-admin account, the hook is enabled when any of the following are true:

    showWorkspaceUsageLimit || workspaceSpendControl || pricePlan != null
    

    pricePlan is non-null for personal paid plans such as Pro, so a normal personal Pro account now enters the workspace settings path.

    In the working build 6119, the equivalent hook was enabled only for workspace/threshold-related conditions:

    showWorkspaceUsageLimit || workspaceSpendControl || rateLimitWarningThreshold != null
    

    The personal paid-plan pricePlan condition was absent, and the workspace settings request was not made.

    Rollback validation

    After rollback and a fresh login, I opened four different historical sessions:

    • 4/4 thread/resume calls succeeded.
    • 0 requests to /accounts/<account>/settings were emitted.
    • 0 desktop_fetch_auth_401, token invalidation, or hasToken=false events occurred.

    The app remained signed in. This was with the same machine, account type, local sessions, network, and stable Codex core.

    Suggested fix

    1. Gate the settings query on an actual workspace account (account.structure === "workspace" or equivalent), not on pricePlan being present.
    2. Do not globally clear/refresh authentication for a 401 from an account-scoped resource when the bearer token remains valid for Codex/usage endpoints.
    3. Treat the expected personal-account rejection locally and default usage_limit_increase_request to unavailable.
    4. Add a regression test for resuming history with a personal paid ChatGPT account.

    This appears to be the same cross-platform endpoint behavior reported in #39189, but the renderer bundle comparison above identifies why personal paid accounts started calling the workspace-only endpoint.

  10. totkd commented on Aug 19, 2026

    @totkd

    Additional independent reproduction, with one UI observation that may be relevant to the workspace-account analysis above.

    • MacBook Pro (Mac14,7), M2, 16 GB
    • macOS 27.0 (26A5416b)
    • 26.810.52044 / build 6662: works
    • 26.814.41407 / build 6720: sign-out loop
    • 26.814.41957 / build 6744: same sign-out loop
    • rollback to 6662: works again immediately

    During the failing login flow, I was also shown a “Choose a workspace” screen that I do not normally see during ChatGPT/Codex sign-in. This may be consistent with the workspace-only path described above, although I did not independently verify the endpoint behavior.

    No local session data needed to be cleared for recovery.

  11. breakaway4here-arch commented on Aug 19, 2026

    @breakaway4here-arch

    I’m seeing the same issue on macOS with ChatGPT/Codex 26.814.41407.

    After signing in again, new conversations seem to work normally. However, opening an existing/older conversation appears to trigger the authentication failure and the app gets signed out.

    Relevant log entries:

    warning [AppServerConnection] app_server_connection.auth_status_result authMethod=chatgpt cacheWrite=null hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing
    
    warning [AppServerConnection] app_server_connection.auth_status_result authMethod=chatgpt cacheWrite=null hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing
    

    A few additional details:

    • Version: 26.814.41407
    • Re-signing in temporarily restores access
    • New conversations seem fine so far
    • Opening an existing conversation appears to reproduce the logout/auth failure
    • The first logout happened before I manually removed any active session from my OpenAI account, so session removal was not the cause

    The refreshToken=true together with hasToken=false / auth_token_missing seems especially relevant.

  12. borystam commented on Aug 19, 2026

    @borystam

    Confirming this is still present on 26.814.41957 (newer than the 26.814.41407 in the title) — macOS, Apple Silicon, ChatGPT-account auth (auth_mode = chatgpt). So the regression carries into 41957, not just 41407.

    Two data points to add:

    Trigger correlation. Every refresh_token_invalidated / auth drop here fires while resuming an existing (older) conversation — the invalidation timestamps line up exactly with bursts of thread/resume for that thread. Freshly created conversations resume fine. (In my case the affected threads all predate enabling account "advanced security," though that may just be because those are the old ones.)

    Second failure mode during resume — thread-store conflict retry storm. Alongside the auth 401, the resume path spams retries:

    resume_thread_with_history:thread_spawn: Failed to create session:
      thread-store conflict: thread <id> already has an active session
    session_init: failed to initialize thread persistence: thread-store conflict: thread <id> ...
    

    Dozens of thread/resume attempts within a few seconds for the same thread, each re-attempting auth — which likely amplifies the token churn.

    Same non-fixes as others: cleared the models cache, reset ~/.codex/auth.json, and logged out of all devices. A fresh login completes and refreshes auth.json normally, but resuming an old conversation reproduces the drop.

  13. totkd commented on Aug 19, 2026

    @totkd

    the affected threads all predate enabling account "advanced security," though that may just be because those are the old ones.

    One additional data point on Advanced Account Security: I also enabled AAS only recently, shortly before encountering this regression.

    I have not established that AAS is causal, and I have not compared pre-AAS vs. post-AAS threads systematically. But given your observation above, I thought the timing might be worth recording in case affected users share an account-state or migration-related characteristic.

  14. 43 remaining items

  15. richcn commented on Aug 25, 2026

    @richcn

    I'm experiencing the same issue on Windows after enabling Advanced Account Security.

    Environment:

    • OS: Windows 11
    • Codex Desktop: 26.818.8289.0 (x64)
    • Codex app-server: 0.149.0-alpha.4.3
    • Authentication: ChatGPT account via browser + Passkey
    • Advanced Account Security: Enabled

    I enabled Advanced Account Security because my account has access to the Daybreak Blue model, so disabling Advanced Account Security is not really a viable workaround for me.

    The browser authentication itself completes successfully, and Codex initially recognizes the account:

    authenticatedAccountPresent=true
    authMethod=chatgpt
    result=succeeded
    

    However, shortly afterwards Codex receives a 401 while the access token is still present:

    desktop_fetch_auth_401
    hadToken=true
    tokenSource=cached
    willRetry=true
    

    About one second later, the authentication state changes to:

    app_server_connection.auth_status_result
    authMethod=chatgpt
    hasToken=false
    nullReason=auth_token_missing
    refreshToken=true
    tokenExpiryState=missing
    

    This is then followed by:

    authenticatedAccountPresent=false
    failureType=account_info_token_unavailable
    result=failed
    

    and:

    401
    Missing valid access token or actor biscuit
    

    The Codex Desktop app then signs me out and returns to the login flow.

    So in my case the sequence appears to be:

    Passkey/browser login succeeds
    → Codex recognizes the authenticated ChatGPT account
    → API request returns 401
    → access token becomes unavailable
    → auth_token_missing
    → account_info_token_unavailable
    → Codex signs out
    

    I can reproduce this consistently. The Passkey/browser authentication itself does not appear to be failing; the session is lost only after Codex has already successfully authenticated.

    This started after enabling Advanced Account Security.

    I can provide the complete Codex Desktop logs if they would help diagnose the token refresh/session handling issue.

  16. totkd commented on Aug 26, 2026

    @totkd

    26.820.60940 / build 7119 still reproduces; brand-new thread creation is affected too

    I tested the current macOS Stable release 26.820.60940 (build 7119) on the same Mac/account that remains stable on 26.810.52044 (build 6662).

    On build 7119:

    • Opening an existing thread immediately signed the app out.
    • After signing in again and explicitly selecting Personal account, I created a completely new thread.
    • I happened to use Codex Spark for this test; I have no evidence that the selected model is relevant to the authentication failure.
    • The new thread itself was created successfully and its first turn started successfully, but the app then entered the same sign-out path.
    • After signing in again, opening that newly created thread also triggered the sign-out.

    The logs show that the thread operations succeed before authentication collapses.

    For an existing thread:

    thread/resume -> errorCode=null
    desktop_fetch_auth_401 hadToken=true -> /backend-api/accounts/:param/settings
    auth_status_result hasToken=false nullReason=auth_token_missing
    account_info_token_unavailable
    

    For the brand-new thread:

    thread/start -> errorCode=null
    turn/start -> errorCode=null
    desktop_fetch_auth_401 hadToken=true -> /backend-api/accounts/:param/settings
    auth_status_result hasToken=false nullReason=auth_token_missing
    account_info_token_unavailable
    

    In the relevant reproduction window, I did not observe refresh_token_invalidated or token_revoked; the /accounts/{account_id}/settings 401 was followed directly by auth_token_missing.

    I then rolled back only the application bundle to 26.810.52044 (build 6662), without clearing ~/.codex, local task data, Keychain, or browser cookies, and without changing AAS or account/workspace state.

    Importantly, I then reopened the same Codex Spark thread that had just triggered the sign-out on build 7119. On build 6662, that exact thread resumed normally and accepted multiple additional turns while the account remained signed in.

    So on the same machine/account/thread data:

    26.820.60940 / 7119 -> existing thread: sign-out
    26.820.60940 / 7119 -> brand-new thread: sign-out
    26.820.60940 / 7119 -> reopening that newly created thread: sign-out
    26.810.52044 / 6662 -> the same newly created thread resumes and continues normally
    

    This further weakens both:

    1. the idea that only historical/older thread state is required to trigger the regression; and
    2. the idea that the newly created thread itself becomes corrupted.

    In this A/B test, the thread data remained in place and changing only the Desktop application bundle back to build 6662 made the same affected thread usable again.

  17. maojianzhong999 commented on Aug 26, 2026

    @maojianzhong999

    Reproduced on the newer production build 26.820.60940 (Build 7119) with bundled codex-cli 0.150.0-alpha.8, on macOS 26.5.2 (25F84), arm64, using a personal ChatGPT Plus account.

    The original reproduction remains exact: browser OAuth completes successfully, the account is initially present, and clicking any existing conversation immediately returns the app to the browser sign-in screen.

    Additional endpoint isolation with the same freshly issued, unexpired token:

    GET /backend-api/wham/usage                         -> HTTP 200
    GET /backend-api/accounts/{redacted}/settings       -> HTTP 401
    response detail: Must use workspace account for this operation
    

    The fresh login sequence records:

    account_login_completed ... success=true
    chatgpt-account-lookup ... authenticatedAccountPresent=true ... result=succeeded
    

    Opening an existing thread then records:

    desktop_fetch_auth_401 hadToken=true target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
    app_server_connection.auth_status_result hasToken=false nullReason=auth_token_missing refreshToken=true
    chatgpt-account-lookup ... authenticatedAccountPresent=false failureType=account_info_token_unavailable result=failed
    

    The bundled CLI remains authenticated and real Codex CLI model calls succeed on the same machine/account/network. Rebuilding the Electron profile, upgrading to 26.820.60940, and completing a new OAuth login with the updated bundled runtime do not change the result.

    This further supports the regression being caused by the desktop client calling a workspace-only settings endpoint for a personal subscription and treating that endpoint-specific 401 as a global auth failure. Tokens, email, account ID, device IDs, conversation IDs, and project names are intentionally omitted.

  18. s1n9t9b9r commented on Aug 26, 2026

    @s1n9t9b9r

    After changing the email address associated with my ChatGPT account, the ChatGPT macOS app entered a persistent authentication loop.

    When I open Codex, the app asks me to log in. I complete the authentication flow successfully in the browser using my new email address, but after being redirected to the macOS app, the session is not established or persisted. Codex immediately displays the login screen again. Repeating the process produces the same result, so Codex is currently inaccessible.

    ChatGPT works correctly in the web browser with the new email address. The problem appears to be isolated to the macOS desktop app and started immediately after the account email change.

    Possible technical cause: the desktop client may still have an authentication token, cached account identifier, or refresh-token binding associated with the previous email address. The browser login succeeds, but the returned OAuth session may not replace or reconcile the stale local authentication state.

    Expected behavior:
    After successful browser authentication, the callback should return to the ChatGPT macOS app, update the locally stored credentials, and open Codex under the existing account.

    Actual behavior:
    The authentication appears to complete, but the app returns to the login screen and starts the login flow again.

    I have already confirmed that I can access the same account through ChatGPT on the web using the new email address. Please investigate whether email-address changes can leave the macOS app with stale account or session data, and advise how I can fully reset the desktop authentication state without losing my existing Codex chats or projects.

  19. mufeiyu-ayu commented on Aug 26, 2026

    @mufeiyu-ayu

    me too,

  20. geegewu commented on Aug 26, 2026

    @geegewu

    Current production build 7119 still breaks active work — this needs urgent prioritization

    I am independently reproducing this on:

    • ChatGPT/Codex Desktop 26.820.60940 (build 7119)
    • macOS 27.0 (26A5416b), Apple Silicon
    • ChatGPT authentication

    This is not a cosmetic login inconvenience. The desktop app can switch to the sign-in screen while Codex is actively working. The only reliable immediate recovery is to fully quit and reopen the application, which interrupts the workflow and makes the desktop client unreliable for ongoing work.

    The underlying credential is not actually gone:

    $ codex login status
    Logged in using ChatGPT
    

    My sanitized Desktop logs show the same failure chain reported here:

    desktop_fetch_auth_401 hadToken=true
    target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
    
    status=401
    detail="Must use workspace account for this operation"
    
    chatgpt-account-lookup
    authenticatedAccountPresent=false
    failureType=account_info_token_unavailable
    
    Failed to retrieve authentication token
    status=432
    

    After quitting and reopening the app, the account is available again without repairing the CLI login. That strongly indicates the Desktop runtime is discarding or hiding a valid authenticated state after a route-scoped authorization failure.

    It is unacceptable for a production desktop client to convert a workspace-only endpoint error into a global logout, especially during an active agent task. Users should not have to repeatedly restart a paid product to keep working, and repeatedly signing in is not a reasonable workaround because it can create duplicate device sessions without addressing the underlying failure.

    This regression has now survived multiple production builds and has many independent reports. Please treat it as a high-priority release blocker rather than a generic authentication issue.

    At minimum, the fix should:

    1. Avoid calling the workspace-only settings route for personal accounts.
    2. Never convert a route-specific 401 into global authentication loss.
    3. Preserve active task UI and recover credentials in place instead of forcing a restart.
    4. Publish a confirmed fixed build and update this issue with its version.

    I have intentionally omitted account IDs, thread IDs, tokens, and project information.

  21. lynnswap commented on Aug 26, 2026

    @lynnswap

    I have some additional findings and a recovery case to share.

    Environment

    • macOS 26.6.2
    • ChatGPT.app 26.820.60940
    • Bundled Codex: 0.150.0-alpha.8
    • Personal ChatGPT account
    • The affected thread could be read correctly from local storage, and thread/resume completed successfully

    A complete local reset did not resolve the issue

    I removed the following state, then reinstalled the app and signed in again, but the same issue remained:

    • ~/.codex
    • Codex-related Application Support directories
    • Cache / HTTPStorage / Cookie / Local Storage data
    • Preferences
    • Logs
    • Authentication state, including Keychain entries

    Each new sign-in reached account_login_completed success=true. However, opening an existing thread caused the authentication state to disappear within a few seconds.

    The observed sequence was:

    thread/resume succeeds
    → GET /backend-api/accounts/{account_id}/settings returns 401
    → Desktop requests auth status with refreshToken=true
    → hasToken=false, nullReason=auth_token_missing
    → account_info_token_unavailable
    → UI returns to the sign-in screen
    

    Subsequent requests were sent without a token and returned:

    Missing valid access token or actor biscuit
    

    Replacing auth.json with credentials issued under a separate CODEX_HOME resolved the issue

    Another local tool on this Mac runs the Codex app-server with an isolated CODEX_HOME:

    ~/.codex_review/auth.json
    

    These credentials were issued for the same ChatGPT account through an independent OAuth session using the Codex 0.147.0 app-server.

    Copying this file, containing credentials for my own account, to the following location immediately resolved the issue:

    ~/.codex/auth.json
    

    Warning

    auth.json contains a refresh token. It must never be obtained from another person, attached to an issue, or otherwise shared. In this case, both files belonged to the same local user and the same ChatGPT account; they were generated under two separate local CODEX_HOME directories.

    After comparing the two files without exposing any secrets, I confirmed that they had the same:

    • account_id
    • issuer
    • audience
    • plan
    • scope
    • auth_mode=chatgpt

    However, the ID token, access token, and refresh token were all different. In other words, they represented separate token families for the same account.

    After the copy, ChatGPT Desktop successfully refreshed ~/.codex/auth.json itself and persisted newly rotated access and refresh tokens. This makes a file-permission problem, write failure, or malformed JSON unlikely to be the sole cause.

    What changed after replacing the credentials

    The /backend-api/accounts/{account_id}/settings request still returns 401, but its response is now:

    Must use workspace account for this operation
    

    This appears to be an authorization error caused by calling a workspace-only endpoint for a personal account.

    The important difference is that authentication now remains intact after this 401. The later auth_token_missing and account_info_token_unavailable events no longer occur.

    At least in this environment, the failure therefore appears to involve these two interacting behaviors:

    1. A workspace-only settings request returns 401 for a personal account.
    2. Desktop treats that 401 as an authentication failure and forces a token refresh. The refresh token issued through the normal Desktop sign-in path then becomes unusable, after which the existing access token is no longer returned to the Desktop shell.

    I could not determine why the refresh token issued through the normal Desktop sign-in path became unusable so soon after a successful login. The original auth.json was overwritten during recovery, and the refresh endpoint's response body was not retained in the Desktop logs available to me.

    However, a separate token family issued for the same account through another OAuth session could be refreshed and persisted successfully by the same Desktop build, on the same machine and network, while opening the same thread.

    This result suggests that the problem is more likely related to the Desktop OAuth sign-in/refresh path, or to its handling of a workspace-only 401 as an authentication failure, than to stale application data or the local thread itself.

  22. turgur commented on Aug 27, 2026

    @turgur

    TL;DR

    If you get a 401 log out when opening existing chats, normal app logouts or deleting local files won't help.
    The Fix: Go to your ChatGPT web account, use “Log out of all sessions/devices”, and sign back in.


    Workaround that fixed this for me

    I was seeing a reproducible logout in the ChatGPT/Codex desktop app when opening an existing conversation.

    The failure sequence in the desktop logs was:

    GET /backend-api/accounts/.../settings → 401 → auth_token_missing → authenticatedAccountPresent=false
    

    I tried the following without success:

    • Completely quitting Cursor (Codex extension was installed, but Cursor was not running)
    • Signing out/in of the desktop app
    • Removing local Codex state, including ~/.codex / auth.json
    • Reinstalling the desktop app
    • Manually terminating the individual active sessions shown for this device

    What finally fixed it was using “Log out of all sessions/devices” from the ChatGPT web account, then signing in again.

    After the global server-side logout and fresh login, existing conversations open normally and the desktop app no longer immediately logs me out.

    So if you're seeing the same 401 → auth_token_missing sequence, try a global logout of all sessions, not just a normal desktop logout or terminating individual active sessions.

    • Desktop version where I reproduced the issue: 26.820.60940 (macOS)

    This suggests the issue may involve stale/inconsistent server-side auth/session state rather than only local auth.json or Electron storage.

    Update: I also have Advanced Account Security (AAS) enabled, and it was enabled before I installed Codex.
    This makes my case consistent with the AAS-related reports in #40611. Notably, the global “Log out of all sessions/devices” workaround still fixed the issue.

  23. stoimenov95 commented on Aug 27, 2026

    @stoimenov95

    I found a workaround that resolved the issue for me:

    1. Sign out of the older Codex desktop app.
    2. In ChatGPT Web, sign out all currently registered Codex devices.
    3. Sign out of ChatGPT Web as well.
    4. Update the Codex desktop app to the latest available version.
    5. Sign in again.

    After completing these steps, I can open any existing conversation without being signed out again.

    This may help anyone encountering the same problem. It appears that fully clearing the existing device and web sessions before signing in with the updated app is the important part, although I have not confirmed the underlying root cause.

    This resolved it on my side as well, thanks OP!

  24. tokezooo commented on Aug 27, 2026

    @tokezooo

    I found a workaround that resolved the issue for me:

    1. Sign out of the older Codex desktop app.
    2. In ChatGPT Web, sign out all currently registered Codex devices.
    3. Sign out of ChatGPT Web as well.
    4. Update the Codex desktop app to the latest available version.
    5. Sign in again.

    After completing these steps, I can open any existing conversation without being signed out again.

    This may help anyone encountering the same problem. It appears that fully clearing the existing device and web sessions before signing in with the updated app is the important part, although I have not confirmed the underlying root cause.

    that worked thanks!

  25. Roarrk commented on Aug 28, 2026

    @Roarrk

    New version deployed today have solved the issue for me.

  26. chunguscodes commented on Aug 28, 2026

    @chunguscodes

    New version is also working for me.

  27. efraim9 commented on Aug 28, 2026

    @efraim9

    New version solved the issue for me as well.

  28. aravhawk commented on Aug 29, 2026

    @aravhawk

    Version 26.825.41651 has resolved the issue for me

  29. mikeg0 commented on Sep 25, 2026

    @mikeg0

    hit this bug today on codex-cli 0.157.0. turns out codex had spawned some processes that went zombie on a long batch job I was running. killing these zombies and re-authing fixed it for me.

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appauthIssues related to authentication and accountsbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions