Interactive CLI hangs on multi-command / branching turns
What version of Codex CLI is running?
codex-cli 0.118.0
What subscription do you have?
Plus
Which model were you using?
gpt-5.3-codex
What platform is your computer?
Darwin 25.2.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
Terminal.app
What issue are you seeing?
Interactive Codex CLI hangs or becomes extremely slow on longer or more agentic turns. Small bounded tasks often work, but once a turn becomes multi-command, branching, retry-heavy, background-terminal heavy, or longer-lived, the interactive session often gets stuck on Working... or degrades into retries / waits / reconnect-like behavior.
This reproduces across multiple machines:
- Ubuntu homelab server
- macOS laptop
- Windows 11 machine
At the same time, codex exec works reliably on the same environments, including command execution and summarization. This makes it look specific to the interactive CLI/TUI orchestration path rather than the underlying model/account or basic shell execution.
What steps can reproduce the bug?
- Start a fresh interactive Codex CLI session.
- Run a small bounded prompt like this:
Run exactly this command and nothing else:
pwd
Then reply only with the result.
This often works.
- Then run a more complex / broader prompt, for example:
Check whether the gateway daemon is running. If stopped, restart it. Inspect config. Check logs. If pairing is required, generate a new pairing code. After fixing, test by attempting to add a simple cron job.
- Observe behavior:
- Codex runs some commands successfully
- then expands scope, uses help commands, background waits, retries, or timeouts
- then gets stuck on Working...
Another repro example is a simple local file task like:
find my ytwhisper app and replace the old one in Applications with this one
Instead of checking a few likely paths and finishing quickly, interactive Codex may do multiple redundant searches (find, rg, mdfind, background waits), take several minutes, and remain on Working...
Important comparison:
codex exec "reply only with hello"workscodex exec --dangerously-bypass-approvals-and-sandbox "run pwd and reply only with the result"workscodex exec --dangerously-bypass-approvals-and-sandboxwith a real docker/log command plus summary also works
So the problem appears much more specific to interactive mode.
What is the expected behavior?
Interactive Codex should be able to perform multi-command, complex CLI workflows reliably.
Expected behavior:
- complete bounded but non-trivial tasks in reasonable time
- not get stuck indefinitely on Working... after commands have already succeeded
- not enter retry / wait / background-terminal loops when a command fails or when partial output is available
- behave consistently with the fact that the same work succeeds in
codex exec
Additional information
Versions tested
- Stable:
codex-cli 0.118.0 - Prerelease tested as well:
0.119.0-alpha.4
Updating to the prerelease did not resolve the issue.
Environments affected
- Ubuntu homelab server
- macOS laptop
- Windows 11 machine
Because the issue reproduces across multiple OSes, it seems unlikely to be only a single-host problem.
Things already tried
- upgraded from stable
0.118.0 - tested prerelease
0.119.0-alpha.4 - no meaningful improvement for the interactive hang issue
Ubuntu-specific environment fixes tried
These were real host issues, but did not fully solve the interactive instability:
- Cleared corrupted local Codex state after a disk-full incident (
auth.jsonandmodels_cache.jsonbecame 0-byte files and caused parse errors likeEOF while parsing a value at line 1 column 0) - Freed disk space after root hit 100%
- Disabled IPv6, which improved some longer-lived tasks on Ubuntu
- Installed missing tools in a target container (
ripgrep) - Diagnosed bubblewrap / AppArmor sandbox issues on Ubuntu (
bwrap: loopback: Failed RTM_NEWADDR: Operation not permittedand AppArmor denies fornet_admin/setpcap) - Bypassed sandbox with
--dangerously-bypass-approvals-and-sandbox
Those Linux-specific issues do not explain why the same higher-level interactive symptom also appears on macOS.
Strong evidence this is interactive-mode specific
Works:codex exec "reply only with hello"
Works:codex exec --dangerously-bypass-approvals-and-sandbox "run pwd and reply only with the result"
Also works:
- a real docker/log command with summary via
codex exec --dangerously-bypass-approvals-and-sandbox
Fails / degrades:
- interactive Codex on multi-command troubleshooting prompts
- branching prompts
- broader search / replacement tasks
- turns involving retries, waits, background terminals, or timeout wrappers
Current workaround
Use:codex exec --dangerously-bypass-approvals-and-sandbox "..."
This is workable, but it is not a replacement for the intended interactive agent workflow.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗