`codex login status` should report daemon auth status separately from stored credentials

Abierto
#64,223 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

Start by tracing the codex login status command and how it obtains stored credential status, then inspect the app-server daemon status interface and its authentication metadata. Keep diagnostics limited to safe status or account metadata. Done means the command reports stored credentials and daemon auth separately, explains any mismatch, and gives the daemon restart command; add or update tests for matching and differing states.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

app-server auth bug CLI
What version of Codex CLI is running?

codex-cli 0.172.0

What subscription do you have?

ChatGPT account (OAuth login)

Which model were you using?

Not model-specific.

What platform is your computer?

macOS, Darwin 27.2.0 arm64

What terminal emulator and version are you using (if applicable)?

tmux

Codex doctor report

Not included. No secrets or token contents are relevant to this report.

What issue are you seeing?

codex login status reports the credentials available to a newly started CLI/app-server process. The regular interactive TUI can instead use an already-running app-server daemon, whose in-memory auth state is authoritative for that session. The command currently does not identify this distinction or report the daemon's auth state.

This makes Logged in using ChatGPT ambiguous: it confirms that credentials are stored for the current CODEX_HOME, but does not tell the user whether the daemon used by the TUI is logged in as well. In my case, with CODEX_HOME="$HOME/.codex1", codex login status reported a ChatGPT login while the TUI showed the sign-in flow. Restarting that daemon made the TUI recognize the account.

This issue is about status and guidance, not a request for the daemon to treat auth.json as a live source of truth. A running daemon may intentionally retain its auth state until it is restarted or explicitly reauthenticated. The CLI should make that lifecycle visible instead of reporting an unqualified status that can disagree with the TUI.

What steps can reproduce the bug?
  1. Start Codex with a CODEX_HOME and let its app-server daemon run.
  2. Copy valid ChatGPT OAuth credentials into that home while the daemon remains running (for example, copy ~/.codex/auth.json to ~/.codex1/auth.json).
  3. Run CODEX_HOME="$HOME/.codex1" codex login status. It reports Logged in using ChatGPT.
  4. Run the regular interactive TUI with the same CODEX_HOME. In this reproduction, it showed the sign-in flow while using the already-running daemon.
  5. Run CODEX_HOME="$HOME/.codex1" codex app-server daemon restart, then launch the TUI again. The sign-in flow disappeared.

No credential values should be included in diagnostics or issue artifacts.

What is the expected behavior?

codex login status should clearly report at least:

  • Whether credentials are present in the active CODEX_HOME for a fresh process.
  • Whether an app-server daemon is running for that home and whether it reports an authenticated account.
  • When those states differ, a clear explanation that the TUI uses the daemon's current in-memory auth state, plus the exact command to reconcile it, such as CODEX_HOME=... codex app-server daemon restart.

The command should compare only safe auth status/account metadata and must not print or expose access or refresh tokens. It should avoid implying that the daemon is broken when it is following its documented process-lifetime auth model; the missing piece is actionable visibility for users.

A daemon auth-reload operation would be a useful follow-up, but it is not required to address the primary diagnostic problem. If reload is unsupported, login status should say so and recommend the restart command.

Additional information

Related issues cover the underlying stale daemon credential behavior: #42771 (closed with the explanation that a running app-server owns its in-memory auth state) and #63304 (API-key rotation). This issue requests a distinct CLI diagnostic: report both the stored credentials and the active daemon state, and explain their mismatch without requiring users to discover the daemon lifecycle themselves.

Lenguaje dominante
Rust
Estrellas
136k
Forks
21.6k
Merge medio
1 min
PR fusionados (30 d)
997

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openai/codex

Todos los issues de openai/codex

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.