NO useful error message when not logged in
What version of Codex is running?
codex-cli 0.27.0
Which model were you using?
gpt-5
What platform is your computer?
Darwin 24.5.0 arm64 arm
What steps can reproduce the bug?
Steps to Reproduce
- After installing Codex and trying to use it without configuring environment variables, there is no auth.json file locally and $OPENAI_API_KEY is null.
- When I start the login process and enter the LoginScreen, if I press Ctrl + C, I enter the chat interface.
What is the expected behavior?
I think that after exiting the LoginScreen with Ctrl + C, since the login was not successful, the subsequent chat should detect this state. If no auth information and no $OPENAI_API_KEY is found, it should immediately return an error like "login required".
Additionally, it would be helpful to add a /login command.
What do you see instead?
I can send messages, but once I send a query, Codex stays stuck showing "working", with reporting stream error
<img width="1652" height="904" alt="Image" src="https://github.com/user-attachments/assets/d35c67b9-ce97-457a-85cc-b959c31f1a67" />
Additional information
I’m not sure if the current behavior is intentional. If you consider this an improvement or an acceptable change, I’d be happy to contribute to Codex. I believe I can fix the above issue and also add the /login command.
Thanks!
5 Comments
If this still persists on the latest version can you please run
/status?Yes, this situation still exists in 0.30.0
This time, the stream error no longer appears, but it stays in the ‘working’ status indefinitely.
<img width="1492" height="1372" alt="Image" src="https://github.com/user-attachments/assets/e9000799-2ebd-41cc-9fdf-6ca8714d0d7c" />
I have created a pull for this issue https://github.com/openai/codex/pull/3234
This situation still exists in 0.47.0
It still stays in the ‘working’ status indefinitely.
<img width="1206" height="948" alt="Image" src="https://github.com/user-attachments/assets/dc48d189-b9d6-4d7b-8dc9-869ac3ceab95" />
If you are using the default model provider and fail to log in, the CLI will now return back to the login menu and ask you to either log in using ChatGPT or provide an API key.