Interactive CLI hangs on multi-command / branching turns

Open 💬 3 comments Opened Apr 3, 2026 by zainepils

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?

  1. Start a fresh interactive Codex CLI session.
  1. Run a small bounded prompt like this:

Run exactly this command and nothing else:
pwd
Then reply only with the result.

This often works.

  1. 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.

  1. 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" works
  • codex exec --dangerously-bypass-approvals-and-sandbox "run pwd and reply only with the result" works
  • codex exec --dangerously-bypass-approvals-and-sandbox with 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:

  1. Cleared corrupted local Codex state after a disk-full incident (auth.json and models_cache.json became 0-byte files and caused parse errors like EOF while parsing a value at line 1 column 0)
  2. Freed disk space after root hit 100%
  3. Disabled IPv6, which improved some longer-lived tasks on Ubuntu
  4. Installed missing tools in a target container (ripgrep)
  5. Diagnosed bubblewrap / AppArmor sandbox issues on Ubuntu (bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted and AppArmor denies for net_admin / setpcap)
  6. 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.

View original on GitHub ↗

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