Login session repeatedly expires
Open 💬 5 comments Opened Aug 23, 2026 by leichangzhang666
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.5229.0
What subscription do you have?
plus
What platform is your computer?
Windows10
What issue are you seeing?
Windows 10 19045,ChatGPT/Codex桌面端版本26.818.5229.0。
网页登录正常,桌面端登录成功后数分钟自动退出。
日志持续出现:
refresh_token_invalidated
codex-doctor.txt
doctor-after-logout.json
Failed to refresh token: 401 Unauthorized
<!-- Failed to upload "codex-doctor.txt" -->
<!-- Failed to upload "doctor-after-logout.json" -->
已清理LocalAppData、删除auth.json、改用Windows keyring、
卸载/停用Codex++、CC Switch和全局Codex CLI,问题仍可复现。
What steps can reproduce the bug?
登陆后点击历史对话
What is the expected behavior?
_No response_
Additional information
no-active-thread-01a02ee8-b1d4-79c3-86b1-6e7cf186cfe6
5 Comments
English translation:
What version of the Codex App are you using (From “About Codex” dialog)?
26.818.5229.0
What subscription do you have?
plus
What platform is your computer?
Windows10
What issue are you seeing?
Windows 10 19045, ChatGPT/Codex desktop app version 26.818.5229.0.
Login works normally on the web, but the desktop app automatically logs out a few minutes after a successful login.
The following continuously appears in the logs:
refresh_token_invalidated
codex-doctor.txt
doctor-after-logout.json
Failed to refresh token: 401 Unauthorized
<!-- Failed to upload "codex-doctor.txt" -->
<!-- Failed to upload "doctor-after-logout.json" -->
I cleared LocalAppData, deleted auth.json, switched to Windows keyring,
and uninstalled/disabled Codex++, CC Switch, and the global Codex CLI, but the issue can still be reproduced.
What steps can reproduce the bug?
After logging in, click a previous conversation.
What is the expected behavior?
_No response_
Additional information
no-active-thread-01a02ee8-b1d4-79c3-86b1-6e7cf186cfe6
<!-- codex-issue-translator -->
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Additional diagnostic details:
This is subsequently followed by
auth_token_missing/401 failures.codex doctor --jsonstill reported:This indicates that local credentials were still present, but the refresh token was rejected or invalidated; the failure was not simply caused by a missing local authentication file.
HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,OPENAI, orCODEXenvironment overrides were detected.%LOCALAPPDATA%\Codex, deleting~/.codex/auth.json, and completing a fresh OAuth login did not resolve the original forced logout.OpenAI.Codex 26.818.5229.0.26.818.5345.0as available, but Microsoft Store/winget did not offer that newer build.The behavior appears related to #39925, #39696, and #39199, but this reproduction does not involve either of the suspected triggers described there: a multi-account ChatGPT Web session or Advanced Account Security. It may share the same downstream
refresh_token_invalidatedfailure mechanism while having a different upstream trigger.A potentially separate recovery issue was also observed during Windows keyring testing. After the related Windows Credential Manager entries were cleared, browser OAuth succeeded, but the callback failed with:
This keyring failure may be separate from the original
refresh_token_invalidatedlogout, but it suggests that the client cannot safely recreate encrypted credential storage after it becomes undecryptable.I can provide a sanitized desktop application log covering the successful login and the first failed refresh if needed. No access tokens, refresh tokens, account IDs, email addresses, or OAuth authorization codes will be included.
Sanitized desktop authentication log
This privacy-reviewed excerpt was produced from the local Codex desktop log archive captured on 2026-08-23.
It contains:
auth_token_missingstates while a refresh token was still detected;401 Unauthorized/refresh_token_invalidatedrefresh failures;Windows usernames and paths, log/session UUIDs, request/connection/conversation IDs, unrelated activity, and all credential values were removed. The excerpt contains no email address, OAuth authorization code, cookie, Bearer token, JWT, API key, access-token value, refresh-token value, or ID-token value.
<details>
<summary><code>Codex-Auth-Logout-Sanitized-Log.txt</code> — click to expand</summary>
</details>
A workaround that is currently working for me on Windows Desktop:
For me, using a completely isolated fresh browser session fixed the repeated sign-in / auto-logout loop and the app is working normally now. Sharing in case this helps others who are blocked.