Sign in with Device Code fails to display code and loops back to the selection menu on headless servers.
What version of Codex CLI is running?
codex-cli 0.104.0
What subscription do you have?
ChatGPT Business
Which model were you using?
gpt-5.3-codex
What platform is your computer?
Linux 6.12.69+deb13-amd64 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
iTerm2 (SSH session to Server)
What issue are you seeing?
When running codex and selecting option 2. Sign in with Device Code, the CLI does not display the verification code or the authentication URL. Instead, the screen flickers/clears and immediately returns to the initial "Welcome to Codex" selection menu.
What steps can reproduce the bug?
- Run
codexon a headless Linux server via SSH. - Navigate to the login selection menu.
- Select
Sign in with Device Code. - Observe the menu refreshing instead of providing the OAuth device code flow information.
What is the expected behavior?
The CLI should provide a user code (e.g., ABCD-1234) and a URL (e.g., https://open.ai/verify) to allow for out-of-band authentication from another device.
Additional information
It seems the TUI (Terminal User Interface) might be failing to handle the transition to the device code display state, or it’s attempting to trigger a browser-based flow as a fallback and failing silently before returning to the main loop.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗