Windows Desktop hangs after successful OAuth and incorrectly reports "Your access token could not be refreshed because your refresh token was revoked

Open 💬 2 comments Opened Jul 27, 2026 by herssede

What version of the Codex App are you using (From “About Codex” dialog)?

OpenAI.Codex 26.721.4979.0 ChatGPT.exe 150.0.7871.128 Codex CLI v0.146.0-alpha.3.1

What subscription do you have?

Pro

What platform is your computer?

Windows 11 x64

What issue are you seeing?

Summary

After successfully authenticating through the browser, the Windows ChatGPT/Codex desktop application immediately reports:

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

However:

Browser OAuth completes successfully.
A fresh %USERPROFILE%\.codex\auth.json is created.
Codex CLI authenticates successfully and works normally.

Only the desktop application fails.

Environment
Windows 11 x64
OpenAI.Codex 26.721.4979.0
ChatGPT.exe 150.0.7871.128
Codex CLI v0.146.0-alpha.3.1
ChatGPT Pro subscription
Reproduction
Launch Codex Desktop.
Choose Sign in with ChatGPT.
Browser opens.
Authenticate successfully.
Browser displays "Signed in to Codex".
Return to the desktop application.
Expected

Desktop completes authentication and opens normally.

Actual

Desktop immediately displays:

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

The desktop app never becomes usable.

Diagnostics

Verified during troubleshooting:

Browser OAuth succeeds.
A fresh auth.json is created.
Codex CLI authenticates successfully and works normally using the same account.
Desktop package was completely uninstalled and reinstalled.
Repair and Reset were both performed.
Windows Event Viewer records:
Application Hang
Event ID: 1002

The program ChatGPT.exe version 150.0.7871.128
stopped interacting with Windows and was closed.

Task Manager shows ChatGPT.exe and multiple Codex helper processes remain running while the UI is hung.

Troubleshooting already attempted
Logout/login
Browser reauthentication
Deleted auth.json
Deleted .codex-global-state.json
Cleared Windows Credential Manager
Repair
Reset
Complete uninstall/reinstall
Windows reboot
Fresh OAuth login

No change.

Additional observation

The same authentication works correctly in the Codex CLI.

This suggests the browser is successfully issuing valid credentials and that the failure is isolated to the Windows desktop application's authentication/session initialization path rather than the refresh token actually being revoked.

<img width="999" height="1310" alt="Image" src="https://github.com/user-attachments/assets/f3cbc289-e988-4c8a-8318-73e0d9e1acde" />

<img width="1058" height="1204" alt="Image" src="https://github.com/user-attachments/assets/0f1cc099-8bd1-474d-885f-9d0ba26b8858" />

<img width="1219" height="315" alt="Image" src="https://github.com/user-attachments/assets/37facba7-328e-4bc5-b524-99bc3beedc15" />

<img width="809" height="298" alt="Image" src="https://github.com/user-attachments/assets/9f1ea300-9b7a-4906-ab3f-bcfadf453e66" />

What steps can reproduce the bug?

See above

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

2 Comments

moo-go-blind · 7 days ago

I am seeing what appears to be the same issue on a newer Windows Codex Desktop build, and I was able to capture the authentication sequence in logs_2.sqlite.

Environment

  • Windows 11 x64
  • Codex Desktop package: OpenAI.Codex 26.818.2441.0
  • Desktop client reported in app-server logs: 26.818.21641
  • Codex CLI: v0.148.0
  • ChatGPT Plus
  • Codex CLI authentication works normally with the same account

Symptom

Codex Desktop can authenticate successfully and can start a new thread normally.

For example:

  1. Sign in to Codex Desktop with ChatGPT.
  2. Create a fresh thread.
  3. Send 1+1?.
  4. The model responds normally with 2.
  5. Shortly after the turn completes, the Desktop app switches back to the Sign in to ChatGPT screen.

This is reproducible even with a completely new thread and a trivial prompt.

Codex CLI does not reproduce the problem. I tested multiple consecutive turns in CLI successfully.

Authentication logs

The Desktop app calls getAuthStatus, reloads the current auth state successfully, and then attempts to refresh the token:

Reloading auth for account ...
Reloaded auth, changed: false
Refreshing token

The request to:

POST https://auth.openai.com/oauth/token

then returns:

401 Unauthorized

and the Codex auth manager logs:

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"
  }
}

This happened even after completely resetting the local authentication state and performing a fresh OAuth login.

Interesting additional sequence

I also captured this sequence during another reproduction:

getAuthStatus
Refreshing token
POST https://auth.openai.com/oauth/token
500 Internal Server Error

Request ID:

e0dac80c-65f9-40f4-9f9b-2829ff2b2c7c

The returned server error was:

The server had an error processing your request.

Approximately 16 seconds later, the next refresh attempt returned:

401 Unauthorized
refresh_token_invalidated

This makes me wonder whether there may be an interaction between refresh-token rotation and a failed/500 refresh response: e.g. the server may rotate/invalidate the refresh token but the client does not receive/persist the replacement token because the request returned 500.

I cannot prove that interpretation from the client logs alone, but the sequence may be useful for investigation.

Troubleshooting already performed

  • Codex Desktop sign out / sign in
  • Fresh browser OAuth
  • Completely closed Codex processes
  • Backed up and removed %USERPROFILE%\.codex\auth.json
  • Confirmed a new auth.json was created after fresh authentication
  • Reset-AppxPackage OpenAI.Codex
  • Reinstalled the Desktop app
  • Disabled Windows notifications
  • Tested with brand-new trivial threads
  • Confirmed Remote Control was not enabled
  • Confirmed no separate Codex CLI process was running during the failing Desktop reproduction
  • Tested Codex CLI independently: CLI works normally across multiple completed turns

The problem continues after a fresh OAuth login.

Process observation

During reproduction there was one Desktop app-server process:

...\OpenAI.Codex_26.818.2441.0_x64__2p2nqsd0c76g0\app\resources\codex.exe
  -c features.code_mode_host=true app-server --analytics-default-enabled

I did not find a second standalone Codex CLI process competing for the token during that reproduction.

Expected behavior

After a successful turn, Codex Desktop should remain authenticated and allow another turn.

Actual behavior

The turn itself completes successfully, but Desktop subsequently performs an auth refresh, receives refresh_token_invalidated, and returns to the ChatGPT sign-in screen.

The same account continues to work normally in Codex CLI.

I can provide additional sanitized logs_2.sqlite excerpts if useful.

GUOBAO-lm · 7 days ago

I can reproduce this on Windows with a newer build.

Environment

Windows 11 x64
Microsoft Store package: OpenAI.Codex_26.818.2441.0_x64__2p2nqsd0c76g0
Codex CLI: 0.148.0-alpha.21
Desktop executable: ChatGPT.exe

Behavior

Browser OAuth completes successfully.
Codex Desktop initially reports:
authenticatedAccountPresent=true
A few seconds later, the first authenticated request to:
GET /backend-api/accounts/{account_id}/settings
returns HTTP 401.
Desktop log then reports:
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
The account lookup then changes to:
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
The backend response is:
Missing valid access token or actor biscuit
The app returns to the sign-in flow.

CLI comparison

codex login status returns:
Logged in using ChatGPT
CLI authentication remains valid after 60+ seconds.
The CLI continues to work while the Desktop app loses authentication.

Troubleshooting already performed

Removed/renamed %USERPROFILE%\.codex\auth.json and performed a fresh OAuth login.
Cleared the Electron/Web profile.
Ran Reset-AppxPackage for OpenAI.Codex.
Verified no CODEX_ACCESS_TOKEN, OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_API_BASE, or CODEX_HOME environment variables are set.
Verified ChatGPT traffic is reachable through the configured proxy/TUN.
Repair and full MSIX reset did not resolve the issue.

The Desktop app still reproduces the same sequence after a full package reset:

authenticatedAccountPresent=true
→ /accounts/{account_id}/settings HTTP 401
→ auth_token_missing
→ account_info_token_unavailable

This appears to be Desktop-specific token/session handling, because the CLI remains authenticated using the same account.