Windows ChatGPT/Codex Desktop loses ChatGPT access token after successful login and redirects to login

Open 💬 10 comments Opened Aug 19, 2026 by shiyuchen274-boop
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

  1. Launch ChatGPT/Codex Desktop.
  2. Sign in using "Continue with ChatGPT".
  3. The desktop UI shows the correct account/avatar.
  4. Create a new Codex conversation.
  5. Send a simple message such as "hello".
  6. The response begins or completes.
  7. The application redirects to the full ChatGPT login page.
  8. Long-running Codex tasks can redirect to the login page before the response is finished.
  9. 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.

View original on GitHub ↗

10 Comments

github-actions[bot] contributor · 8 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39170
  • #39162

Powered by Codex Action

tctx41812-stack · 7 days ago

我也遇到了这个bug,只不过我现在我是电脑是Windows 10的 Windows 10 19045
请问兄弟,你这个bug解决了吗?或者说OpenAI修复了吗

kuaijing915-afk · 6 days ago

I can reproduce the same issue on Windows.

My affected desktop versions:

  • 26.818.2441
  • 26.818.3698

Codex CLI 0.149.0 remains authenticated using ChatGPT and completes real requests successfully.

My desktop log shows the same sequence:

  • authenticatedAccountPresent=true
  • about 33 seconds later: hasToken=false
  • nullReason=auth_token_missing
  • refreshToken=true
  • desktop_fetch_auth_401
  • skipRetryReason=no_token_attached

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

kuaijing915-afk · 6 days ago

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.

willinghear · 6 days ago

我也遇见了这个问题:I am also experiencing this bug on my Windows device.

Environment

  • OS: Windows 11 x64
  • Installation method: Microsoft Store / MSIX
  • Installed package version: OpenAI.Codex_26.818.3698.0
  • Authentication method: Continue with ChatGPT
  • Subscription: ChatGPT Plus
  • The same account works normally on chatgpt.com

What 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:

  • In a new blank conversation, the first prompt can be executed successfully, but the application redirects me to the full login screen after the response finishes.
  • In an existing non-empty conversation, sending a prompt also causes the application to redirect to the login screen.
  • After the redirect, I cannot continue using the conversation.
  • If I completely terminate all ChatGPT/Codex processes and restart the application, my signed-in state is restored automatically without another browser login.
  • As soon as I use Codex again, the same logout behavior occurs.

Authentication state

I checked the local authentication state without exposing any token values:

AuthMode        : chatgpt
HasTokens       : True
HasAccessToken  : True
HasRefreshToken : True

The modification time of auth.json is 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:

HTTP 401 Unauthorized
Missing valid access token or actor biscuit

They also include authentication states such as:

hadToken=false
skipRetryReason=no_token_attached
hasToken=false
nullReason=auth_token_missing
authenticatedAccountPresent=false
failureType=account_info_token_unavailable

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:

  • Signing out and completing a fresh ChatGPT login
  • Completely terminating and restarting the application
  • Manually updating the Windows application
  • Testing both new and existing conversations
  • Checking the authentication file and its permissions
  • Clearing or renaming application cache and session data
  • Using Windows App Repair
  • Reinstalling the application
  • Testing different projects
  • Checking for conflicting authentication-related environment variables
  • Confirming that the same account works normally in the ChatGPT web application

None of these actions resolved the issue.

During troubleshooting, I also encountered a separate OAuth error:

token_exchange_failed
Token exchange failed: error sending request for url
(https://auth.openai.com/oauth/token)

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.

goagain-qidong · 5 days ago

Additional Windows reproduction on a newer 26.818 build.

Environment

  • Windows x64
  • Microsoft Store / MSIX desktop app
  • Failing package: OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0
  • Login method: Continue with ChatGPT

What 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:

  • completely quit Codex/ChatGPT processes
  • removed the existing ~/.codex profile
  • removed %LOCALAPPDATA%\OpenAI\Codex
  • ran Reset-AppxPackage
  • signed in again
  • created a brand-new conversation on the clean profile

The 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:

Received turn/completed for unknown conversation

Then a token-bearing account settings request gets a 401:

desktop_fetch_auth_401
hadToken=true
tokenSource=cached
willRetry=true
target="GET https://chatgpt.com/backend-api/accounts/:param/settings"

Immediately afterwards app-server auth state becomes:

authMethod=chatgpt
hasToken=false
nullReason=auth_token_missing
refreshToken=true
tokenExpiryState=missing

Then account lookup reports:

authenticatedAccountPresent=false
failureType=account_info_token_unavailable
result=failed

and the settings request reports:

status=401
Missing valid access token or actor biscuit

Subsequent requests are sent with:

hadToken=false
skipRetryReason=no_token_attached

Re-login behavior

A manual login succeeds:

account_login_completed ... success=true

The conversation itself can also resume successfully:

thread/resume ... errorCode=null
maybe_resume_success ... latestTurnStatus=completed

But within seconds the same account-settings 401 -> auth_token_missing -> account_info_token_unavailable sequence repeats and the desktop UI becomes signed out again.

Crash diagnostics

This does not look like a normal process crash:

  • no matching Windows Application Error event was produced
  • no new Windows CrashDump was generated
  • Sentry session reported status=ok, errors=0

This 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.0 with 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.

zsc6525-cpu · 5 days ago

I can independently reproduce this on Windows with the same authentication sequence.

Environment:

  • Windows 11 x64, build 26200
  • ChatGPT/Codex Desktop MSIX: OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0
  • Desktop app version: 26.818.5229.0
  • Bundled app-server reported 0.149.0-alpha.4.1

Observed sequence after a completely fresh login:

account_login_completed ... success=true
desktop_fetch_auth_401 hadToken=true ... /accounts/:param/settings
app_server_connection.auth_status_result authMethod=chatgpt cacheWrite=null hasToken=false nullReason=auth_token_missing refreshToken=true tokenExpiryState=missing
chatgpt-account-lookup ... authenticatedAccountPresent=false failureType=account_info_token_unavailable
Missing valid access token or actor biscuit

The newly written ~/.codex/auth.json contained an access token issued by https://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:

  • Fully removed and reinstalled the official Store package
  • Cleared/renamed the MSIX app data and %LOCALAPPDATA%\OpenAI\Codex
  • Renamed ~/.codex/auth.json and completed a genuinely fresh browser login
  • Ensured the package was physically installed on the C: system volume
  • Fully terminated all Desktop processes before relaunching
  • Tested two different proxy exit nodes/regions; the same sequence reproduced
  • Confirmed the new JWT was not expired

A previous cross-volume MSIX relocation problem was fixed separately; after that fix all bundled_executable_relocation_failed / EXDEV errors 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:

[devicecheck-attestation] DeviceCheck attestation unavailable ... errorCode=1

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.

qicaiy · 5 days ago

I can independently reproduce this exact issue on another Windows system.

Environment

  • Windows 11 Pro x64, build 26200
  • Microsoft Store / MSIX: OpenAI.Codex_26.818.5229.0_x64__2p2nqsd0c76g0
  • Bundled app-server: codex-cli 0.149.0-alpha.4.1
  • Login method: Continue with ChatGPT (browser OAuth)

Repeated timeline from one uninterrupted app session

Times below are local time (UTC+8):

  • login completed at 17:53:55; auth_token_missing at 18:07:46
  • login completed at 18:08:19; auth_token_missing at 18:23:18
  • login completed at 18:27:33; auth_token_missing at 18:36:02
  • login completed at 18:36:15; auth_token_missing at 18:38:43
  • login completed at 18:38:50; auth_token_missing at 18:51:39
  • login completed at 18:51:55; auth_token_missing at 18:58:42

The failure sequence is:

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

followed immediately by:

  • authenticatedAccountPresent=false
  • failureType=account_info_token_unavailable
  • HTTP 401 Missing valid access token or actor biscuit

At 19:00:23, after the 18:58 failure and without another login:

  • %USERPROFILE%\.codex\auth.json still contained both access-token and refresh-token fields.
  • The file had not been modified since the successful 18:51:55 login.
  • The access token expiry was 2026-09-02T10:51:53Z, so it was not expired.
  • codex login status still returned Logged in using ChatGPT.

Additional checks:

  • Local clock differed from the server by only about 1.3 seconds.
  • No HTTP/HTTPS proxy variables were present.
  • No forced_login_method or forced workspace configuration was present.
  • The cached credentials remain readable by the bundled CLI.

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.

vela129-glitch · 4 days ago

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:

  • Windows
  • Codex Desktop
  • ChatGPT Plus

This issue is still reproducible today and is significantly disrupting longer conversations and tasks.

littlepatato666 · 3 days ago

I can independently reproduce this issue on a newer Windows Codex Desktop build.

Environment:

  • Codex Desktop: 26.818.8289.0
  • Windows x64
  • Sign-in method: Continue with ChatGPT
  • Advanced Account Security: NOT enabled

Reproduction:

  1. Open Codex Desktop.
  2. Sign in through the browser.
  3. Browser authentication completes successfully.
  4. Codex Desktop initially recognizes the authenticated account.
  5. Within roughly 20–60 seconds, authentication is lost and the app returns to the sign-in state.

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.