Your access token could not be refreshed - Codex fix
Quick fix
Quit and restart Codex completely (or kill the codex process) to clear the stale authorisation, then sign in again.
Symptom
Section titled “Symptom”Your access token could not be refreshed because your refresh token was revoked. Please log out and sign in again.This error comes from the Codex desktop app: restarting after `codex /exit` does not use the latest authorisation but keeps the original, so the refresh token is judged revoked. The comments confirm the stopgap is restarting the machine or killing the `codex` process. The same cluster holds two more Codex state-not-synced variants: in #3618, after deleting the OpenAI Official provider and signing out, the Codex app stays stuck on the login screen; in #5736, history is blank after switching config and `.codex-global-state.json` has to be deleted to recover. Neither has a maintainer-confirmed unified fix — they only note both relate to Codex still reading old state after a config switch.
Run `codex /exit` to quit Codex (do not just close the window), then end any leftover `codex` processes.
Reopen Codex and sign in with the latest authorisation. If it still reports `Your access token could not be refreshed...`, restart the machine and sign in again.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 3 real issues
- How exactly do I sign in again on a remote server over ssh?
- The comments explain: the cause is that restarting after `codex /exit` does not use the latest authorisation and keeps the original. Restarting the machine resolves it, and so does killing the codex process.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.