openai / openai/codex

[macOS][CLI] Phantom auth error on resume; thread works after prompt

Open
#39,806 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug CLI session
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

I use ChatGPT Desktop for some Codex threads and the standalone Codex CLI for others on the same macOS machine and ChatGPT account.

One existing local CLI thread emits the following error during resume/bootstrap:

Your access token could not be refreshed because you have since logged out or signed in to another account. Please sign in again.

However, this is a phantom error: the thread is actually usable. Sending the next prompt to that thread works normally, without another login. Another existing thread resumes without this warning under the same current login and machine state.

Environment
  • macOS on Apple Silicon
  • Uses both ChatGPT Desktop and the standalone Codex CLI for different threads on the same machine/account
  • Standalone CLI: codex-cli 0.148.0
  • ChatGPT Desktop bundled runtime: codex-cli 0.148.0-alpha.21
  • Authentication: ChatGPT OAuth stored in ~/.codex/auth.json (cli_auth_credentials_store = "file")
  • Local resume, not an SSH remote connection
  • Several Codex app-server clients/integrations were running concurrently (Desktop, VS Code integration, and other local integrations)
Reproduction
  1. Start from a fresh zsh process.
  2. Run codex resume <affected-thread-id> for the affected existing local thread.
  3. The CLI emits the error above during startup.
  4. Send a prompt to the apparently failed resumed thread.
  5. The prompt is processed normally; the thread was usable despite the error.

The affected thread's local rollout remains intact and records a terminal event with codex_error_info: "unauthorized" before the usable subsequent interaction.

Diagnostics already attempted
  • codex logout, then browser-based codex login, then retry: the phantom error remained, but the thread was usable afterward.
  • Resuming from the original repository directory and without model/config overrides: same result.
  • Started a fresh zsh process: same result.
  • Confirmed the active local auth cache has ChatGPT mode plus non-empty access and refresh tokens.
  • Confirmed no CODEX_ACCESS_TOKEN, OPENAI_API_KEY, OPENAI_BASE_URL, or CODEX_HOME override is present in the shell or GUI launch environment. No secrets are included here.
Expected behavior

If a resumed thread is usable, Codex should not show or persist a terminal unauthorized / re-login error. The CLI should either complete resume cleanly or report a non-terminal warning with accurate recovery guidance.

Potentially related issues

These may share an auth-cache / app-server symptom, but this report differs because the affected thread remains usable after the displayed error:

I can provide the affected thread ID, a sanitized rollout excerpt, and process/version details privately if maintainers need them.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the codex resume <affected-thread-id> bootstrap path and inspect how the local ~/.codex/auth.json state and concurrent app-server clients produce the terminal codex_error_info: "unauthorized" event. Reproduce with the listed CLI versions and rollout, then verify that a usable resumed thread completes cleanly or reports only an accurate non-terminal warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, rust
Domain
authentication, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.