Codex CLI hangs indefinitely on any prompt ("Working…" forever) and stops responding mid-session
What version of Codex is running?
Codex CLI v0.63.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
gpt-5.1-codex Also tested with: gpt-5.1-codex-max gpt-5.1-codex-mini gpt-4.1-mini
What platform is your computer?
Windows 10 (latest patches) Also tested under WSL2 Ubuntu 22.04, same issue Node/NPM installed; codex installed globally via npm Using both PowerShell and CMD and WSL bash
What issue are you seeing?
Codex suddenly stopped responding mid-session while it was working on a task. It became unresponsive and began displaying raw code snippets instead of English responses, then eventually hung permanently.
Since then:
Any prompt results in “Working…” forever in interactive mode
codex exec "Say 'pong'" never returns output
Some models return 401 Unauthorized even though API key works
curl https://api.openai.com/v1/models with the same API key works, so the key is valid
Reinstalling Codex, clearing config, resetting API keys, re-authenticating, and switching machines all fail
When running with DEBUG=true, it hangs immediately after mcp startup: no servers
The failure happens even on an empty directory and after fresh login.
This appears to be a Codex CLI internal hang, not an environment or API issue.
What steps can reproduce the bug?
Run any Codex command, e.g.:
codex exec "Say 'pong' and nothing else."
Codex initializes normally, shows model, sandbox, and session ID
Output always ends here:
mcp startup: no servers
A flashing cursor appears and the tool never returns a response
Sometimes Codex attempts reconnects and ends with:
ERROR: exceeded retry limit, last status: 401 Unauthorized
Any interactive prompt (even on an empty folder) hangs forever on “Working…”
This happens on:
Windows PowerShell
Windows CMD
WSL2 Ubuntu
After fresh login
After reinstalling
After clearing ~/.codex
With new API keys
With multiple models
What is the expected behavior?
Codex should:
Execute the prompt
Return output normally (e.g., “pong”)
Not hang on initialization
Not silently stall at mcp startup: no servers
Not incorrectly produce 401s when the API key is valid
Additional information
Additional information
Issue started mid-session while Codex was actively making file edits.
The tool was functioning normally for hours prior.
After it hung once, it has never recovered even after complete environment rebuild.
API key works for the normal Chat Completions API, confirming the issue is specific to the Codex CLI.
Let me know if logs or a reproducible environment zip is needed.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗