OpenAI Codex CLI error
Codex CLI: Your access token could not be refreshed because your refresh token was...
Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.Status: Fixed in releaseLast verified 2 documented fixes4 sources
What it means
Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again.
Causes
- Maintainer etraut-openai (#9634): an older copy of Codex (CLI or IDE extension) left running in the background can cause this.
- A hole in token refresh logic for the app server used by the IDE extension, fixed in PR #11802.
How to fix it
- Fix 1.
Update Codex. Maintainers said this is fixed in 0.117.0 and added more logging; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.
- Fix 2.
Log out and sign in again, as the message says, and close older Codex CLI or extension processes that may still be running.
Terminalcodex logout codex login
More Codex CLI errors
All 14 Codex CLI errorsstream disconnected before completion: stream closed before response.completedStatus: Workaroundstream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses)Status: OpenError running remote compact task: stream disconnected before completion: error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)Status: Fixed in releaseSelected model is at capacity. Please try a different model.Status: By designCodex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.Status: Fixed in releaseError logging in: Port 127.0.0.1:1455 is already in useStatus: WorkaroundToken exchange failed: token endpoint returned status 403 ForbiddenStatus: WorkaroundMCP client for `playwright` failed to start: program not foundStatus: Fixed in release
Related reading
- Agent Harness Lessons From a 500B-Token Decompile: Give Agents a PASS/FAIL OracleAgent harness lessons from a 500B+ token decompile: a byte-matching PASS/FAIL oracle beat the reviewer agent. How agents cheated it and what to copy.
- Codex CLI Needs Resource Budgets, Not Just Token BudgetsA trending Codex SQLite WAL bug is a useful warning for every local coding agent: logs, disks, background processes, and telemetry paths need budgets too.
- Harness Engineering Makes Tokens a Systems BudgetHarness engineering turns tokens into a systems budget. OpenAI's Codex post and Tokenomics research say agent teams need budgets, receipts, and eval loops.
- Codex Training Setting Re-Enabled? Two Switches to CheckDevelopers report Codex model training turning itself back on. What OpenAI documents, the second "Include environments" switch most people miss, and a five-minute check.
- OpenAI Pando: The Git Backend Built for Codex-Scale PushesOpenAI built Pando, a Git-compatible backend, after Codex flooded its monorepo with pushes. What it changed, the trade-offs, and what it means for your agent fleet.
- T3 Code: Open-Source GUI for Claude Code and CodexT3 Code is a free, MIT-licensed desktop, web and mobile app that drives Claude Code, Codex, Cursor, OpenCode and more. What it is, how remote access works, and what to check first.
FAQ
What does "Your access token could not be refreshed because your refresh token was..." mean in Codex CLI?
Codex tried to refresh your ChatGPT sign-in, but the refresh token had already been consumed, so the session cannot authenticate until you sign in again.
How do I fix "Your access token could not be refreshed because your refresh token was..."?
There are 2 documented fixes. Start with the first: Update Codex. Maintainers said this is fixed in 0.117.0 and added more logging; PR #11802 (Fixed a hole in token refresh logic for app server) first shipped in 0.105.0.
Is this Codex CLI error fixed?
Status: Fixed in release. A release fixed this. The affected versions note says where the fix landed. Affected versions: Reported on v0.88.0 (#9634); maintainers say fixed in 0.117.0
Sources
Last verified against 4 sources: official docs, maintainer replies and release notes.
Newsletter
Fixes for the tools you use, weekly
One email per week. New coding agent releases, what broke, and how developers are working around it.