openai / openai/codex

Windows Codex Desktop authentication cannot recover after refresh_token_invalidated (0.150.x)

Open
#40,820 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

0.150.0-alpha.8 (app-server)

What subscription do you have?

ChatGPT Pro

What platform is your computer?

Windows 10 x64

What issue are you seeing?

Summary

After renewing my ChatGPT Pro subscription, Codex Desktop and the local VSCode Codex extension entered a broken authentication state.

Remote VSCode sessions that were already authenticated before the renewal continue to work normally.

However, any new authentication on my local Windows machine fails.

Desktop login eventually reports:

Your access token could not be refreshed because your refresh token was revoked.
Please log out and sign in again.

The browser OAuth flow opens successfully, but Desktop never completes authentication.


Environment

  • Windows 10 x64
  • ChatGPT Pro
  • Codex Desktop 0.150.0-alpha.8
  • VSCode Codex client_version=0.150.0
  • Chrome
  • Corporate network

Reproduction

  1. Launch Codex Desktop.
  2. Click "Continue with ChatGPT".
  3. Browser opens.
  4. Login succeeds.
  5. Select Personal Workspace.
  6. Click Continue.
  7. Browser remains on the consent page or closes.
  8. Desktop eventually shows:

Login timed out

or

Your access token could not be refreshed because your refresh token was revoked.


Expected

Desktop should complete OAuth and obtain a fresh access token.


Actual

Desktop continuously receives HTTP 401 responses.

Authentication never recovers.

Remote VSCode sessions authenticated before the issue continue to work.

Local Windows authentication cannot recover.


Evidence

Desktop log:

  • auth_token_missing
  • hasToken=false
  • refreshToken=true

Desktop repeatedly reports:

desktop_fetch_auth_401

VSCode repeatedly reports:

token_invalidated

refresh_token_invalidated

401 Unauthorized

Examples:

GET /wham/tasks/list -> 401

GET /wham/usage -> 401

GET /backend-api/codex/models -> 401

The browser is already logged into ChatGPT Pro.


Already Tried

  • Restart Desktop
  • Restart Windows
  • Browser Incognito login
  • Clear Codex Local Storage
  • Clear Codex Network cache
  • Clear Cache
  • Delete AppData cache
  • Verified localhost callback listener
  • Verified DNS
  • Verified browser login
  • Verified ChatGPT Pro is active

Nothing resolved the issue.


Additional Observation

Remote VSCode sessions authenticated before the incident continue working.

Only local Windows authentication fails.

It appears the Desktop client cannot recover after the refresh token becomes invalid.[

Codex_logs_20260826.zip
vscode-codex-output.log

](url)

What steps can reproduce the bug?
  1. Launch Codex Desktop on Windows 10.
  2. Click "Continue with ChatGPT".
  3. Chrome opens the OAuth login page.
  4. Log in successfully with a ChatGPT Pro account.
  5. Select "Personal Workspace".
  6. Click "Continue".
  7. Browser stays on the consent page (or returns without completing login).
  8. Codex Desktop eventually reports:
    • Login timed out
    • or "Your access token could not be refreshed because your refresh token was revoked."

For the VSCode extension:

  1. Open a local Windows VSCode window.
  2. Open the Codex sidebar.
  3. Existing authentication is rejected.
  4. The extension continuously reports 401/token_invalidated errors.
What is the expected behavior?

Codex Desktop and the VSCode extension should discard the invalid refresh token, complete the browser OAuth flow, obtain a new access token, and recover automatically without entering a permanent authentication failure state.

Additional information

Important Findings

During investigation I collected logs from both Codex Desktop and the VSCode extension.

Desktop initializes successfully and the embedded app-server starts correctly.

After receiving the first authentication failure the client transitions into the following state:

  • refreshToken=true
  • hasToken=false
  • auth_token_missing

After that point the Desktop never performs a successful authentication recovery.

Instead it repeatedly retries authenticated requests without attaching a usable access token.

The application continuously sends requests such as:

  • /wham/tasks/list
  • /wham/usage
  • /backend-api/codex/models

Every request receives HTTP 401.

The VSCode extension also reports:

  • token_invalidated
  • refresh_token_invalidated

Meanwhile:

  • ChatGPT Web works normally.
  • The account is ChatGPT Pro.
  • Existing remote VSCode sessions authenticated before the incident continue to work.
  • Only new authentication on the local Windows machine fails.

The issue does not reproduce in an existing Remote SSH VSCode session authenticated before the incident, but consistently reproduces on new local Windows authentication.
Image

Codex_logs_20260826.zip
vscode-codex-output.log

This issue appears to be an authentication state recovery bug rather than an OAuth login failure.

The browser login succeeds, but after the refresh token becomes invalid the Desktop enters a permanent unauthenticated state and never recovers automatically.

Logs and screenshots are attached.

The issue started immediately after renewing my ChatGPT Pro subscription.

I can still use Codex in an existing Remote SSH VSCode session that was authenticated before the renewal.

Only new authentication on the local Windows machine fails.

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 Codex Desktop OAuth flow and the local VSCode authentication path described in the reproduction, focusing on handling of refresh_token_invalidated and repeated 401 responses. Use the attached Desktop and VSCode logs to follow the transition from refreshToken=true and hasToken=false. Done means an invalid refresh token is discarded, browser authentication completes, and local Windows clients recover with a fresh access token.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
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.