openai / openai/codex

[Windows][26.818.8289.0] Codex Desktop loses ChatGPT auth while CLI and server session remain active

Open
#40,632 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app app-server 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.818.8289.0

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Windows 10 x64

What issue are you seeing?

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

The underlying Codex authentication remains valid: while Desktop is already showing the login screen, codex.cmd login status still reports:

Logged in using ChatGPT

I performed additional diagnostics to determine whether this was caused by corrupted local credentials.

I completely closed Codex Desktop and backed up/removed:

C:\Users<user>.codex\auth.json
C:\Users<user>.codex\auth.json.old

I then launched Codex Desktop and performed a completely fresh ChatGPT login.

The fresh login succeeds:

account_login_completed ... success=true

and the account is initially recognized correctly.

However, after normal use / ChatGPT conversation activity, Desktop loses its access-token state and logs out again.

A reproduction showed:

chatgpt_conversation_refetch_started ... reason=explicit_update

followed almost immediately by:

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

Then:

authenticatedAccountPresent=false
authMethod=chatgpt
failureType=account_info_token_unavailable
result=failed

Authenticated requests subsequently fail with HTTP 401:

"Missing valid access token or actor biscuit"

Important control test:

After Desktop has returned to the login screen, without logging in again:

codex.cmd login status

still returns:

Logged in using ChatGPT

I also checked ~/.codex/auth.json before and after the Desktop logout.

The file did NOT change:

  • Size remained identical
  • LastWriteTime remained identical
  • SHA-256 remained identical

Therefore the underlying auth.json does not appear to be deleted, rewritten, or corrupted when Desktop loses authentication.

In an earlier reproduction, the Desktop logs also showed:

Failed to refresh token: 401 Unauthorized
Your refresh token has been invalidated. Please try signing in again.
code: refresh_token_invalidated

There are also messages around successful login such as:

RPC session was shut down by disposing the main stub

but Desktop successfully recognizes the account after this event, before authentication later collapses.

This appears to be a Desktop runtime/auth synchronization issue rather than loss of the underlying Codex/ChatGPT credentials.

Similar reports exist in #39170, #39685, #39491, and #39696, but I am reporting this separately because the issue is still reproducible on Codex Desktop 26.818.8289.0 and I performed additional auth.json/CLI control tests.

What steps can reproduce the bug?
  1. Launch Codex Desktop 26.818.8289.0 on Windows.

  2. Sign in using ChatGPT.

  3. Confirm that login succeeds and Codex is usable.

  4. Use Codex normally and interact with ChatGPT.

  5. After conversation activity/background synchronization, Codex Desktop eventually returns to the "Sign in to ChatGPT" screen.

  6. Do NOT sign in again.

  7. Open PowerShell and run:

    codex.cmd login status

  8. Observe that CLI still reports:

    Logged in using ChatGPT

  9. Check ~/.codex/auth.json and observe that it has not been modified by the Desktop logout.

The issue also reproduces after removing auth.json/auth.json.old and performing a completely fresh ChatGPT authentication.

What is the expected behavior?

Codex Desktop should remain authenticated as long as the underlying ChatGPT/Codex credentials are valid.

Desktop should not lose its access-token state while Codex CLI remains successfully authenticated using the same ChatGPT credentials.

Additional information

Troubleshooting / diagnostics already performed:

  • Located and inspected Codex Desktop logs.
  • Confirmed successful ChatGPT login.
  • Observed auth_token_missing with refreshToken=true.
  • Observed account_info_token_unavailable.
  • Observed HTTP 401 "Missing valid access token or actor biscuit".
  • Observed refresh_token_invalidated in an earlier reproduction.
  • Completely reset ~/.codex/auth.json and auth.json.old.
  • Performed a fresh ChatGPT login.
  • Issue still reproduced.
  • Verified auth.json does not change when Desktop logs out.
  • Verified Codex CLI remains logged in while Desktop is logged out.
  • Windows Credential Manager does not contain an obvious OpenAI/Codex credential entry.

I can provide sanitized Desktop logs containing the full reproduction if needed.

For security reasons, I will not attach auth.json because it contains authentication credentials.

Additional server-side verification:

While Codex Desktop is already showing the "Sign in to ChatGPT" screen:

  • codex.cmd login status still returns Logged in using ChatGPT.
  • ChatGPT Settings → Security and sign-in → Active sessions still shows the corresponding Codex session as active.
  • ~/.codex/auth.json remains unchanged.

Each successful Desktop re-login creates another Codex entry in Active sessions, while previous Codex sessions remain listed.

This further suggests that the server-side session and underlying credentials remain valid, while Codex Desktop loses its local/runtime authentication state.

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 logout with Codex Desktop on Windows and compare its logs, ~/.codex/auth.json, and codex.cmd login status before and after conversation activity. Trace the reported auth_token_missing, account_info_token_unavailable, and HTTP 401 events. Done means Desktop retains authentication when the underlying CLI session and credentials remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
authentication, desktop, operating-systems
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.