Windows ChatGPT/Codex Desktop loses ChatGPT access token after successful login and redirects to login
Description
I am experiencing a reproducible authentication bug in the Windows ChatGPT/Codex Desktop application.
The application successfully completes the "Continue with ChatGPT" browser login. The desktop UI then shows the correct ChatGPT account/avatar and appears to be fully logged in.
However, when I use Codex, the desktop auth bridge stops providing the ChatGPT access token to backend requests. The application receives HTTP 401 responses and redirects me to the full ChatGPT login screen.
The web version of ChatGPT works normally with the same account.
Environment
- OS: Windows 11 x64
- CPU: AMD Ryzen 9 8940HX
- GPU: NVIDIA RTX 5060 + AMD integrated graphics
- Login method: Continue with ChatGPT (browser OAuth)
- Windows distribution: Microsoft Store / MSIX
- Codex runtime shown in UI: 26.818.11542
- Installed package observed in logs: OpenAI.Codex_26.814.5167.0_x64__2p2nqsd0c76g0
- WebView2: 151.0.4129.93
Reproduction
- Launch ChatGPT/Codex Desktop.
- Sign in using "Continue with ChatGPT".
- The desktop UI shows the correct account/avatar.
- Create a new Codex conversation.
- Send a simple message such as "hello".
- The response begins or completes.
- The application redirects to the full ChatGPT login page.
- Long-running Codex tasks can redirect to the login page before the response is finished.
- Restarting the application automatically restores the logged-in UI, but the same problem reproduces again.
The problem affects both historical conversations and newly created conversations.
Web application
The same ChatGPT account works normally on chatgpt.com.
Historical conversations also work normally in the web app.
Key log evidence
The desktop log shows that login completes successfully:
account_login_completed ... success=true
However, backend requests subsequently fail because no ChatGPT token is attached:
desktop_fetch_auth_401
hadToken=false
skipRetryReason=no_token_attached
The backend returns:
HTTP 401 Unauthorized
During an actual new conversation, the app-server reports:
authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing
The account lookup then reports:
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
A later request returns:
Missing valid access token or actor biscuit
Troubleshooting already performed
I have already tried:
- deleting ~/.codex
- clearing/renaming cache and sessions
- deleting the affected project
- testing new projects
- testing new conversations
- uninstalling/reinstalling the Windows application
- using Windows App Repair
- clearing MSIX app cache/state
- signing out and signing in again
- changing auth.json/cap_sid
- checking Windows Credential Manager
- checking CODEX_ACCESS_TOKEN / OPENAI_API_KEY environment variables
- confirming WebView2 is installed
- disabling GPU acceleration
- closing the web ChatGPT application and reproducing with desktop-only
- checking Reliability Monitor
- checking Windows Application Event Log
- checking Windows Error Reporting
- checking CrashDumps
- checking Windows Defender protection history
- checking Controlled Folder Access
- confirming the user has full write access to %LOCALAPPDATA%\OpenAI\Codex
None of these resolved the issue.
Additional observation
After completing "Continue with ChatGPT" login, the modification time of:
%USERPROFILE%\.codex\auth.json
does change, so the login flow does update the local credential file.
Despite that, the desktop app later reports hasToken=false / auth_token_missing and sends backend requests without an access token.
Desktop feedback session
I also submitted the issue through the desktop application's feedback flow with the current session included.
Session ID:
no-active-thread-01a01a45-49c1-7d73-b206-d12add0181e1
Attached diagnostics
I can provide the full main-process Codex desktop log if needed.
Expected behavior
After successful ChatGPT login, Codex Desktop should retain a usable authenticated session and attach the required ChatGPT access token to backend requests.
If authentication refresh fails, the app should recover or display a clear authentication error rather than silently redirecting the entire application to the login page.
Actual behavior
The UI remains visibly logged in, but backend requests lose the ChatGPT access token, receive HTTP 401 responses, and the application redirects to the full login page.
Please investigate the Windows Desktop ChatGPT/Codex authentication bridge / token propagation path.
codex-desktop-9d5e4b06-b895-49e6-9639-35fa0269264b-20044-t0-i1-133839-0.log
[This]([url](url)) appears related to existing Codex Desktop authentication issues such as #30775 and #28149, but the failure here is reproducible on the current Windows ChatGPT/Codex Desktop build and also occurs for normal Codex conversations.
10 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
我也遇到了这个bug,只不过我现在我是电脑是Windows 10的 Windows 10 19045
请问兄弟,你这个bug解决了吗?或者说OpenAI修复了吗
I can reproduce the same issue on Windows.
My affected desktop versions:
Codex CLI 0.149.0 remains authenticated using ChatGPT and completes real requests successfully.
My desktop log shows the same sequence:
I have reproduced the issue after resetting AppX, rebuilding the WebView profile, isolating CC Switch, removing proxy configuration, and testing two desktop versions.
I am attaching a sanitized desktop log and an evidence package.
Codex-Desktop-Auth-Log-Sanitized.txt
Codex-Desktop-Auth-Evidence-20260821-191223.zip
Additional note: Advanced Account Security is not enabled on my account. The Security settings page shows “Enroll”, and Lockdown Mode is also disabled. Therefore, this issue reproduces without Advanced Account Security enabled.
我也遇见了这个问题:I am also experiencing this bug on my Windows device.
Environment
OpenAI.Codex_26.818.3698.0chatgpt.comWhat happens
I can successfully complete the browser login. The desktop application then displays the correct ChatGPT account and avatar and appears to be signed in normally.
However, the following problems occur when I use Codex:
Authentication state
I checked the local authentication state without exposing any token values:
The modification time of
auth.jsonis also updated after a successful login.Despite this, the desktop application later behaves as though no usable ChatGPT access token is available.
Log evidence
The desktop logs contain errors such as:
They also include authentication states such as:
This indicates that requests are being sent without the required ChatGPT access token, even though the account login completed successfully and the local authentication file still contains both access and refresh tokens.
Troubleshooting attempted
I have already tried:
None of these actions resolved the issue.
During troubleshooting, I also encountered a separate OAuth error:
I resolved that connection/login error and then successfully completed a fresh OAuth login. However, the original logout and missing-access-token problem remained unchanged.
This suggests that the OAuth login itself is successful and that the credentials remain stored locally, but the Windows desktop authentication bridge or app-server stops attaching or propagating the ChatGPT access token when a Codex request is made.
I can provide updated, sanitized desktop logs if they would help with the investigation.
Additional Windows reproduction on a newer 26.818 build.
Environment
OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0What changed / reproduction
The problem started after updating the desktop app. Initially, opening any existing Codex conversation caused the desktop app to return to the sign-in screen.
I then performed a full clean reset to rule out migrated or corrupted local state:
~/.codexprofile%LOCALAPPDATA%\OpenAI\CodexReset-AppxPackageThe issue still reproduces with a new conversation: when the turn completes, the desktop authentication state collapses and the app returns to the sign-in screen. So old conversations / old SQLite state are not required to reproduce it.
Sanitized log sequence
Near turn completion the desktop log contains:
Then a token-bearing account settings request gets a 401:
Immediately afterwards app-server auth state becomes:
Then account lookup reports:
and the settings request reports:
Subsequent requests are sent with:
Re-login behavior
A manual login succeeds:
The conversation itself can also resume successfully:
But within seconds the same account-settings 401 ->
auth_token_missing->account_info_token_unavailablesequence repeats and the desktop UI becomes signed out again.Crash diagnostics
This does not look like a normal process crash:
status=ok,errors=0This looks like a desktop auth-state failure triggered around conversation completion/resume rather than corrupted historical conversation data.
I have now downgraded the desktop package to an earlier 26.810 build for comparison/testing, but the reproduction above is from
26.818.5229.0with a completely fresh local profile.This appears to be the same underlying Windows desktop auth regression described in this issue, and also closely related to #39850.
I can independently reproduce this on Windows with the same authentication sequence.
Environment:
OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g026.818.5229.00.149.0-alpha.4.1Observed sequence after a completely fresh login:
The newly written
~/.codex/auth.jsoncontained an access token issued byhttps://auth.openai.com; its JWT expiry was about 10 days in the future, so it was not expired when the backend returned 401. On one clean run, login completed successfully and the first authenticated 401 occurred about 16 seconds later.Troubleshooting performed:
%LOCALAPPDATA%\OpenAI\Codex~/.codex/auth.jsonand completed a genuinely fresh browser loginA previous cross-volume MSIX relocation problem was fixed separately; after that fix all
bundled_executable_relocation_failed/EXDEVerrors disappeared, but this authentication failure remained unchanged.This also does not appear to be a process crash: the Electron processes remain alive and responsive after the UI returns to/appears to close into the login state. The Windows logs show no new crash event for these reproductions.
One additional recurring diagnostic is:
No tokens, account IDs, usernames, subscription details, or local paths containing the username are included here. This looks like the same Windows Desktop auth bridge/token propagation defect reported in this issue.
I can independently reproduce this exact issue on another Windows system.
Environment
OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0codex-cli 0.149.0-alpha.4.1Repeated timeline from one uninterrupted app session
Times below are local time (UTC+8):
auth_token_missingat 18:07:46auth_token_missingat 18:23:18auth_token_missingat 18:36:02auth_token_missingat 18:38:43auth_token_missingat 18:51:39auth_token_missingat 18:58:42The failure sequence is:
app_server_connection.auth_status_result authMethod=chatgpt hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missingfollowed immediately by:
authenticatedAccountPresent=falsefailureType=account_info_token_unavailableMissing valid access token or actor biscuitAt 19:00:23, after the 18:58 failure and without another login:
%USERPROFILE%\.codex\auth.jsonstill contained both access-token and refresh-token fields.2026-09-02T10:51:53Z, so it was not expired.codex login statusstill returnedLogged in using ChatGPT.Additional checks:
forced_login_methodor forced workspace configuration was present.This looks like the Desktop app's in-process authentication bridge/cache losing access to a still-valid token while the on-disk auth cache and CLI authentication remain healthy.
No token values, account IDs, or raw logs are included here. I can provide a separately sanitized log excerpt if maintainers need it.
I am still experiencing the same issue on Codex Desktop for Windows as of August 24, 2026.
Codex signs in successfully and works normally for a while, but during active conversations it repeatedly returns to the ChatGPT sign-in screen. This has happened several times today.
Signing in again restores access temporarily, but the issue eventually happens again.
The same ChatGPT account remains signed in and works normally on chatgpt.com.
I also tried submitting feedback directly from Codex Desktop, but the feedback submission itself failed.
Environment:
This issue is still reproducible today and is significantly disrupting longer conversations and tasks.
I can independently reproduce this issue on a newer Windows Codex Desktop build.
Environment:
Reproduction:
Relevant log sequence:
account_login_completed success=true
chatgpt-account-lookup:
authenticatedAccountPresent=true
result=succeeded
Then shortly afterwards:
desktop_fetch_auth_401
target="GET https://chatgpt.com/backend-api/accounts/:param/settings"
hadToken=true
app_server_connection.auth_status_result
hasToken=false
nullReason=auth_token_missing
refreshToken=true
chatgpt-account-lookup
authenticatedAccountPresent=false
failureType=account_info_token_unavailable
The logs also contain:
Failed to refresh token: 401 Unauthorized
code="refresh_token_invalidated"
and:
Missing valid access token or actor biscuit
This appears reproducible across multiple fresh login attempts.
Importantly, Advanced Account Security is NOT enabled on my account, so the issue does not appear to require that setting.
I can provide additional sanitized logs or reproduction data if useful.