openai / openai/codex

[Windows][26.820.9563.0] Codex Desktop repeatedly loses auth after account-settings 401 while ChatGPT Web remains signed in

Open
#41,136 5 comments 1 reaction 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)?

26.820.9563.0

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

Codex Desktop on Windows repeatedly loses authentication during normal use and returns to the "Sign in to ChatGPT" screen.

ChatGPT Web remains signed in and functional at the same time.

The Desktop logs repeatedly show the following authentication failure sequence:

GET /backend-api/accounts/{account_id}/settings
→ HTTP 401

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

chatgpt-account-lookup
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
result=failed

sa_server_request_failed
errorMessage="Missing valid access token or actor biscuit"
status=401

Before the authentication state is lost, the account-settings request can show:

desktop_fetch_auth_401
hadToken=true
tokenSource=cached
willRetry=true

Afterward, subsequent requests show:

hadToken=false
skipRetryReason=no_token_attached

and return HTTP 401 Unauthorized.

Signing in again temporarily restores the Desktop session, but the same failure repeats.

Interestingly, Codex background work may still complete and Windows may display a task-completion notification even after the Desktop UI has returned to the sign-in screen.

ChatGPT Web remains authenticated when this occurs.

No account IDs, tokens, email addresses, or other PII are included above.

What steps can reproduce the bug?
  1. Launch Codex Desktop on Windows.
  2. Sign in successfully with ChatGPT.
  3. Use Codex normally by opening an existing conversation or starting a task.
  4. Wait while Codex remains open and in normal use.
  5. Codex Desktop eventually performs an account-settings request.
  6. /backend-api/accounts/{account_id}/settings returns HTTP 401.
  7. Desktop auth state changes to:

hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing

  1. Account lookup then reports:

authenticatedAccountPresent=false
failureType=account_info_token_unavailable

  1. Codex Desktop returns to the "Sign in to ChatGPT" screen.
  2. ChatGPT Web remains signed in.
  3. Sign in to Codex Desktop again.
  4. The issue reproduces again.

This has reproduced multiple times during the same day.

Session ID: Not included because I do not know which identifier is safe and useful for this report. I can provide a sanitized session identifier privately if requested.

Token-limit usage: Not applicable / unknown.

Context-window usage: Not applicable; the logout can occur independently of high context usage.

What is the expected behavior?

After successful ChatGPT authentication, Codex Desktop should remain authenticated during normal use.

A 401 response from the account-settings endpoint should not cause an otherwise authenticated Desktop session to lose its access-token state while a refresh token is still present.

If token renewal is required, Codex should successfully refresh the access token or surface a recoverable authentication error instead of entering a repeated sign-in loop.

ChatGPT Web and Codex Desktop should remain consistently authenticated unless the account session is actually revoked.

Additional information

Environment:

Windows 11
x64
Codex Desktop 26.820.9563.0

Security configuration checked:

Advanced Account Security: Not enrolled
Lockdown Mode: Off
Developer Mode: Off
Authenticator MFA: Off
SMS MFA: Off

Important observations:

ChatGPT Web remains signed in while Codex Desktop signs out.
Re-authenticating Codex Desktop creates another Codex session, but the issue eventually repeats.
Background Codex work may continue and Windows task-completion notifications may still appear after the Desktop UI has returned to the sign-in screen.
The failure has reproduced repeatedly.
Microsoft Store currently offers no newer Desktop update on this machine.
A winget upgrade check also reports no newer available package.
Advanced Account Security is not enrolled, so this reproduction does not require that feature to be enabled.

The observed failure sequence is:

authenticated
→ account-settings HTTP 401
→ auth_token_missing
→ refreshToken=true
→ account_info_token_unavailable
→ Desktop sign-in screen

This appears very similar to existing Windows Codex Desktop authentication issue #39850.

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 /backend-api/accounts/{account_id}/settings request and the logged auth state transitions from desktop_fetch_auth_401 through auth_token_missing and account_info_token_unavailable. Reproduce the sequence on Windows with Codex Desktop 26.820.9563.0. Done means the Desktop session no longer enters a repeated sign-in loop after this failure, or presents a recoverable authentication error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.