Live codex cli session cannot continue on auth refresh (api login)

Open 💬 4 comments Opened Apr 7, 2026 by qmaldon

What version of Codex CLI is running?

0.118.0

What subscription do you have?

Corporate (login method is "api")

Which model were you using?

gpt-5.4

What platform is your computer?

Linux 5.15.0-316.196.4.1.el8uek.x86_64

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

Gnome Terminal

What issue are you seeing?

On token expiration (auth.json) an external refresh (login in different process) does not fix existing live sessions.


Reconnecting... 1/5
Reconnecting... 2/5
Reconnecting... 3/5
Reconnecting... 4/5
Reconnecting... 5/5
unexpected status 401 Unauthorized: { "code" : "NotAuthenticated", "message" : "The required information to complete authentication was not provided or was incorrect." }, url: https://<redacted>

What steps can reproduce the bug?

Keep a live session with API-based authentication. Let it expire.
Refresh auth (login) from separate CLI.
Run any prompt on pre-existing live session.

What is the expected behavior?

The pre-existing live sessions should detect the authentication failure and attempt to do an internal refresh if auth.json has mutated.

Additional information

High impact on headless Codex use.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗