When I launch the Codex CLI, it always displays “Welcome to Codex, OpenAI’s command-line coding agent” and prompts me to re‑authenticate from Sign in with ChatGPT. Even after logging in, the same screen appears again on the next startup.

Since there was an issue this morning, I initially thought the service might still be unstable and confused that with this behavior. However, when I changed the launch method locally and compared the results, the re‑authentication screen this time was tied to the state of the local background server. I’m not sure whether this morning’s outage caused that state.

Isolating the Phenomenon

First, I checked the authentication status in the same terminal.

$ codex login status
Logged in using ChatGPT

The CLI reports that it is already logged in. Nevertheless, a normal codex startup still presented the sign‑in screen. In contrast, when launching without using the background server, the sign‑in screen did not appear.

$ codex --no-daemon

This confirmed that the saved authentication credentials themselves were not missing. During the investigation, ~/.codex/auth.json was present, and no authentication failure was reported even with codex doctor. The background server logs recorded a WebSocket connection (401 Unauthorized) during the time the issue occurred.

Cause and Countermeasure

The results differed between a normal startup and --no-daemon, and the server logs also included a 401 error, indicating that the background server was likely using outdated authentication state. However, we have not verified exactly which information was not updated on the server side. Based solely on the 401, we cannot determine a causal relationship with this morning’s outage.

After finishing the CLI work, I restarted the background server.

$ codex app-server daemon restart
$ codex

After the restart, the sign‑in screen no longer appeared on a normal codex launch. Deleting the authentication file or re‑logging into ChatGPT was not necessary.

If the same issue occurs again, first inspect the saved authentication state with codex login status and compare it with codex --no-daemon. If re‑authentication is required only on a normal startup, verify that there is no active session and then try codex app-server daemon restart.

The mechanism by which Codex CLI caches authentication information locally is described in OpenAI’s authentication documentation. (documentation)