Windows Desktop hangs after successful OAuth and incorrectly reports "Your access token could not be refreshed because your refresh token was revoked
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_
2 Comments
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
OpenAI.Codex 26.818.2441.026.818.21641v0.148.0Symptom
Codex Desktop can authenticate successfully and can start a new thread normally.
For example:
1+1?.2.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:The request to:
then returns:
and the Codex auth manager logs:
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:
Request ID:
The returned server error was:
Approximately 16 seconds later, the next refresh attempt returned:
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
%USERPROFILE%\.codex\auth.jsonauth.jsonwas created after fresh authenticationReset-AppxPackage OpenAI.CodexThe problem continues after a fresh OAuth login.
Process observation
During reproduction there was one Desktop app-server process:
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.sqliteexcerpts if useful.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.