Windows Stable: opening a thread immediately invalidates fresh OAuth refresh token with Advanced Account Security enabled; Beta works
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.21641
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What issue are you seeing?
After enabling Advanced Account Security on my OpenAI account, the stable Windows Codex app can successfully sign in, but opening/resuming a Codex thread causes the app to lose the session and return me to the login screen.
The initial OAuth login itself succeeds. A fresh ~/.codex/auth.json is written and the newly issued access token is usable.
However, shortly after opening a thread, Stable calls getAuthStatus, attempts to refresh the OAuth token, and the refresh request is rejected by https://auth.openai.com/oauth/token with:
401 Unauthorized
code: refresh_token_invalidated
message: "Your refresh token has been invalidated. Please try signing in again."
The app then treats the account as signed out.
This is reproducible after a fresh login.
Important control case: the Codex Beta app works correctly on the same PC, Windows installation, network, OpenAI account, Advanced Account Security configuration, and shared ~/.codex directory.
Installed Beta package:
OpenAI.CodexBeta 26.727.4816.0
Beta app-server logs identify its client version as:
26.727.40816
With Beta, I can open the same existing thread and send prompts normally. Requests to /backend-api/codex/responses have:
auth_header_attached=true
auth_mode="Chatgpt"
auth_error=""
auth_error_code=""
During the same operation, Beta does NOT perform the immediate getAuthStatus -> Refreshing token -> /oauth/token sequence seen in Stable, and there are no 401 Unauthorized, token_revoked, or refresh_token_invalidated errors.
This problem started immediately after I enabled Advanced Account Security.
What steps can reproduce the bug?
- Use a Windows account with Advanced Account Security enabled.
- Launch stable Codex for Windows:
About version: 26.818.21641
AppX package: OpenAI.Codex 26.818.2441.0
- Sign in with ChatGPT through the browser OAuth flow.
- Browser authentication succeeds and Codex reports the login as completed.
Example log sequence:
received login callback ... has_code=true ... state_valid=true
starting oauth token exchange
oauth token exchange succeeded status=200 OK
account/login/completed
- Open or resume an existing Codex thread.
- Stable subsequently performs:
getAuthStatus
Reloading auth
Refreshing token
- Codex sends:
POST https://auth.openai.com/oauth/token
and receives:
401 Unauthorized
{
"error": {
"message": "Your refresh token has been invalidated. Please try signing in again.",
"type": "invalid_request_error",
"code": "refresh_token_invalidated"
}
}
- Codex returns to the login screen.
In one reproduction, the fresh OAuth login completed at approximately 13:14:57 local time and the refresh token was rejected at approximately 13:15:04 — only a few seconds after the successful login.
The access token itself was still usable: the Codex /responses WebSocket successfully connected with an attached ChatGPT authorization header around the same time the refresh operation failed.
Failed refresh request ID from that reproduction:
bad1fcb3-a0c8-4634-a078-c8079f502dce
Stable vs Beta A/B test
I also tested Codex Beta with Stable completely closed.
Process inspection confirmed the only running Codex backend was:
C:\Program Files\WindowsApps\OpenAI.CodexBeta_26.727.4816.0_x64__2p2nqsd0c76g0\...
With Beta:
- The same existing thread resumes successfully.
- Prompts can be sent and responses are received.
- ChatGPT authorization is attached successfully.
- No immediate OAuth refresh occurs when opening/using the thread.
- No
refresh_token_invalidatederror occurs. - The app remains logged in.
Therefore this appears to be a behavioral regression between the current Stable and Beta Windows clients rather than a general inability of the account to authenticate.
What is the expected behavior?
After a successful OAuth login, opening or resuming a Codex thread should keep the authenticated session active.
If the current access token is valid, the Stable app should be able to use it normally, as the Beta app does.
A newly issued refresh token should not be reported as refresh_token_invalidated only a few seconds after a successful OAuth exchange.
If a token refresh fails while the existing access token is still valid, the desktop app also should not immediately discard an otherwise working authenticated session and return the user to the login screen.
Additional information
Troubleshooting already performed
- Manually logged out individual old Codex sessions from ChatGPT Security settings.
- Reset the Windows app data.
- Performed fresh OAuth logins.
- Confirmed a new Codex active session is created server-side after login.
- Confirmed
~/.codex/auth.jsonis freshly rewritten by the login. - Confirmed no CodexBeta or legacy ChatGPT Desktop process was running during Stable reproduction.
- Confirmed only the expected Stable
ChatGPT.exeprocesses and its childcodex.exewere running. - Reproduced the problem after resetting the application.
- Tested Beta as a control, where the same account works normally.
12 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Seeing the same issue, started yesterday after i moved over to passkeys. It has also been posed in: https://github.com/openai/codex/issues/39803
I have been using the beta build without any issues since yesterday, if you havent, I would suggest trying that if you do not wish to disable your advanced account security setting.
Works a treat now, thank you
Same issue happening with me, removed my passkey, yubikey and disabled advanced security and still closing on every time i click a chat and asking me to sign in again currently on desktop app version 26.818.21641
Try using the beta app until they get it fixed, that worked for me
我已崩溃,一直不能登陆,win10商店最新版,
I am experiencing the same issue on Windows 11 Pro after enabling Advanced Account Security.
Windows Hello authentication succeeds and the desktop app initially signs me in. However, opening any ordinary ChatGPT conversation immediately returns me to the sign-in screen.
I also reproduced the problem in Codex. I created a new Codex chat and sent “testing.” Codex thought for approximately seven seconds and began streaming a response, but after displaying only two or three words, the app returned to the sign-in screen.
ChatGPT web and the iOS app work normally.
Troubleshooting attempted: app update, Windows restart, Terminate, Repair, and revoking recent Codex sessions. The fault remains.
Current Windows app version: 26.818.3698.0
Feedback ID: no-active-thread-01a0255d-303e-7940-a396-cc9851b1bbfd
I have not Reset or uninstalled the app because I have local Work chats that may not be synchronised.
I'm experiencing the same issue.
Temporary workaround that currently works for me:
Use Codex CLI or ->
This at least lets me keep using Codex while the desktop app auth is broken.
Reporting another independently observed Windows Stable reproduction of the same core failure sequence.
Environment
26.818.41509UTC+09:00)Sanitized timeline from local app logs
On 2026-08-22, browser OAuth callbacks were accepted (
state_valid=true,has_error=false) and token exchanges succeeded withHTTP 200at approximately:The desktop auth manager then attempted to refresh authentication and received
401 Unauthorizedwithcode: refresh_token_invalidatedfive times at approximately:The server message was:
Thus, fresh OAuth login/token exchange repeatedly succeeded, but the issued authentication state became unusable seconds later, producing a sign-in loop.
The same local log database contains an earlier run from client
26.818.31338at 07:15 KST with a token-refresh attempt but no correspondingcodex_login::auth::managererror. All five recorded auth-manager errors occurred later under26.818.41509. This version correlation is diagnostic context, not proof that the client update is the root cause.I have not established whether Advanced Account Security was enabled for this account, so this reproduction confirms the immediate refresh-token invalidation symptom but not that particular trigger.
No token values, account IDs, request IDs, thread IDs, conversation contents, email addresses, or raw log archives are included.
Follow-up from the same affected Windows machine: after the
refresh_token_invalidatedsign-in loop, restarting Codex Desktop also makes the existing conversation history disappear from the UI.Read-only inspection shows this is not deletion: all 63 user-created local threads remain unarchived and present in the state database, session index, local display catalog, and rollout files, with successful SQLite integrity checks.
One affected long paginated thread has an exact duplicate-ordinal boundary: ordinal
591is written first astoken_countand again asthread_settings_applied. The stored projection cursor expects ordinal592, encounters591, and then logsthread history projection expected ordinal 592, got 591on every advancement attempt. The error persisted across 3 Desktop/app-server processes and accumulated at least 542 times while the canonical rollout continued growing intact.Full sanitized measurements and the catalog/host mismatch observed after reauthentication are documented here:
https://github.com/openai/codex/issues/40178#issuecomment-5385380415
The projection failure began after the authentication loop on the same day, but this is temporal correlation only; I am not claiming that the authentication failure is proven to have caused the duplicate ordinal.
No credentials, identifiers, conversation content, filenames, absolute paths, or raw logs/databases are included.
As stated in the main thread, please try installing ChatGPT (Beta) from the windows store, "Version 26.727.40816 • Beta" seems to not suffer from this issue. This is the only known reliable work around so far.