Skip to content

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.

Error output
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.

  1. Run `codex /exit` to quit Codex (do not just close the window), then end any leftover `codex` processes.

  2. 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.

ToolCodex
Version3.16.1 - 3.18.0(受影响范围;修复版本未在 issue 中说明)
PlatformsWindowsmacOS
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.

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.