openai / openai/codex

[Windows 26.814] Opening an existing thread signs out a personal Pro account after workspace-only settings 401

Open
#39,189 28 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app auth bug windows-os
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)?

OpenAI.Codex 26.814.5167.0 (desktop client 26.814.41407; bundled Codex core 0.148.0)

What subscription do you have?

ChatGPT Pro (personal account)

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

After updating the former Codex app to the unified ChatGPT desktop app, browser-based ChatGPT sign-in succeeds and an existing Codex conversation initially opens correctly. A few seconds later, the desktop app switches to the signed-out state and asks the user to sign in again.

The fresh access token is unexpired and is accepted by the Codex models endpoint (HTTP 200). The failure starts when the unified desktop client requests /backend-api/accounts/{account_id}/settings, which returns HTTP 401. A direct read-only verification of the same endpoint returns:

Must use workspace account for this operation

The client then calls getAuthStatus(refreshToken=true); OAuth refresh returns HTTP 401 with refresh_token_invalidated, and the UI signs out.

This report intentionally excludes access tokens, refresh tokens, email addresses, account IDs, thread IDs, and raw log archives.

What steps can reproduce the bug?
  1. Launch the Windows unified ChatGPT/Codex desktop app.
  2. Complete browser-based "Sign in with ChatGPT" using a personal ChatGPT Pro account.
  3. Open an existing Codex conversation.
  4. Wait several seconds.
  5. Observe that the app returns to the signed-out state.

Observed timeline after a full Windows App reset:

  • OAuth token exchange succeeds with HTTP 200.
  • account/login/completed; a fresh auth.json is written.
  • The existing thread resumes successfully (159 items, 0 parse errors).
  • The Codex models endpoint returns HTTP 200 using the fresh access token.
  • The desktop request to /backend-api/accounts/{account_id}/settings returns HTTP 401.
  • The desktop client forces getAuthStatus(refreshToken=true).
  • OAuth refresh returns HTTP 401 with refresh_token_invalidated.
  • The desktop UI switches to signed out.

Recovery steps already attempted, with no change:

  • Removed and regenerated auth.json.
  • Set cli_auth_credentials_store = "file".
  • Disabled and stopped third-party token-keeper/injection software.
  • Fully reset the Windows App package with Reset-AppxPackage.
  • Recreated package-local cache and state directories.
  • Signed in from the ChatGPT surface before returning to Codex.
What is the expected behavior?

The desktop app should accept the valid personal Pro ChatGPT token and keep the user signed in. It should avoid a workspace-only account-settings request for a personal account, or handle that HTTP 401 without treating the otherwise valid Codex session as invalid.

Additional information

This is related to, but more specific than, #35673. In this case the desktop app becomes usable after OAuth and can resume the thread; the forced sign-out occurs only after the workspace-only settings request fails.

Environment details:

  • Package: OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0
  • Standalone Codex CLI 0.147.0 works with the same account.
  • The stored account ID matches the access-token account claim.
  • No other Codex App or CLI process issued a refresh request during the failure window.

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 tracing the desktop client's requests to /backend-api/accounts/{account_id}/settings and the subsequent getAuthStatus(refreshToken=true) flow; auth.json and the reported HTTP responses provide the observed sequence. Reproduce with a personal ChatGPT Pro account and verify that a valid Codex session remains signed in when the workspace-only settings request returns 401.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authentication, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.