openai / openai/codex

[macOS][26.820.60940] Personal Pro account logs out after /accounts/{account_id}/settings returns "Must use workspace account"

Open
#41,010 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app auth bug
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: 26.820.60940

What subscription do you have?

Personal ChatGPT Pro

What platform is your computer?

Darwin 25.6.0 arm64 arm

What issue are you seeing?

Reproduction prompt/action:

  1. Sign into the ChatGPT macOS desktop app with a personal ChatGPT Pro account.
  2. Create a new chat.
  3. Send the message:

TEST RESUME CHAT

The app immediately logs out.

The same behavior occurs when opening/resuming an existing chat or project.

Relevant desktop log output, with identifiers redacted:

2026-08-27T00:55:58.129Z warning [electron-fetch-wrapper] desktop_fetch_auth_401 hadToken=true skipRetryReason=null target="GET https://chatgpt.com/backend-api/accounts/:param/settings" tokenSource=cached willRetry=true

2026-08-27T00:55:58.401Z warning [AppServerConnection] app_server_connection.auth_status_result authMethod=chatgpt cacheWrite=null hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing

2026-08-27T00:55:58.585Z info [electron-message-handler] [chatgpt-account-lookup] completed accountInfoHttpStatus=undefined accountsHttpStatus=undefined authenticatedAccountPresent=false authMethod=chatgpt failureType=account_info_token_unavailable hasEverErrored=false result=failed windowType=electron

2026-08-27T00:55:58.611Z info [electron-message-handler] remote_connections.connection_state_changed error={
"code":"connection-failed",
"message":"{
"level":"ERROR",
"fields":{
"message":"Failed to refresh token: 401 Unauthorized: {
\"error\": {
\"message\": \"Your refresh token has been invalidated. Please try signing in again.\",
\"type\": \"invalid_request_error\",
\"param\": null,
\"code\": \"refresh_token_invalidated\"
}
}"
},
"target":"codex_login::auth::manager"
}"
}

After this failure, subsequent requests are sent without a usable access token:

desktop_fetch_auth_401 hadToken=false skipRetryReason=no_token_attached target="GET https://chatgpt.com/backend-api/wham/:param/:param" tokenSource=cached willRetry=false

sa_server_request_failed errorMessage={"detail":"Unauthorized"} status=401 routePattern=/wham/onboarding/context

I separately tested the access token immediately after the desktop app logged out.

GET https://chatgpt.com/backend-api/wham/usage

Result:

HTTP 200

Using the same access token:

GET https://chatgpt.com/backend-api/accounts/[REDACTED_ACCOUNT_ID]/settings

Result:

HTTP 401

Response body:

{"detail":"Must use workspace account for this operation"}

This indicates that the access token remains valid after the desktop UI considers the session unauthenticated.

The first failing request appears to be the account settings endpoint, which rejects the request because the authenticated account is a personal ChatGPT Pro account rather than a workspace account. The desktop client then appears to interpret this endpoint-specific 401 as a global authentication failure, clears/rejects the valid access token, attempts a refresh, receives refresh_token_invalidated, and logs the user out.

What steps can reproduce the bug?

Feedback ID: no-active-thread-01a040c1-1389-70e0-8361-3497be5ef1ec

What is the expected behavior?

workspace-account-only endpoint failure should not cause a valid personal ChatGPT Pro session to be treated as unauthenticated or force a logout.

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the macOS logout with a personal ChatGPT Pro account and trace the GET /backend-api/accounts/{account_id}/settings response through the desktop_fetch_auth_401 and codex_login auth paths shown in the logs. Done means a workspace-only 401 does not invalidate the valid personal session or force logout, while genuine authentication failures still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.