Unified exec never detaches from long-running streaming commands (e.g. docker compose logs --follow)
Resolved 💬 2 comments Opened Oct 30, 2025 by marcohefti Closed Oct 30, 2025
What version of Codex is running?
codex-cli 0.50.0
What subscription do you have?
Pro
Which model were you using?
gpt-5-codex-high
What platform is your computer?
MacOS Darwin 24.6.0 arm64 arm
What issue are you seeing?
Running docker compose logs --follow <service> through Codex (and other streaming commands listed below) causes the agent to stay attached to the output indefinitely. Unified exec keeps the PTY session open, so the run remains “in progress” even after hours with no new output unless Ctrl‑C is sent manually.
<img width="442" height="58" alt="Image" src="https://github.com/user-attachments/assets/91ecb4fb-c7aa-4de5-a348-1e05dd6ade47" />
What steps can reproduce the bug?
- In an interactive Codex session, ask the agent to inspect container logs (e.g. “run
docker compose logs --follow web”). - Approve the unified exec command if prompted.
- Observe that the agent starts tailing the logs but never exits, even when there is no new output.
What is the expected behavior?
Either:
- unified exec should timeout/auto‑detach from indefinite streaming commands, or
- Codex should fall back to the regular shell tool (which enforces the default timeout) unless the user explicitly asks for a persistent session, or
- the UI should surface a way to send Ctrl‑C/terminate the session automatically once the agent has gathered enough context.
Additional information
- The default shell tool path applies a 10 s timeout (
codex-rs/core/src/exec.rs) but unified exec does not (codex-rs/core/src/unified_exec/session_manager.rs). - The hang in my example persisted for ~10 hours until the process was manually interrupted.
- Other commands that are expected to exhibit the same issue:
tail -f,kubectl logs -f,journalctl -f,watch …,npm run dev,cargo watch,docker compose up,python manage.py runserver,top/htop, or any PTY-driven command that streams until interrupted.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗