Agent stuck on "Waited for background terminal" after command finishes
What version of Codex CLI is running?
0.114.0
What subscription do you have?
plus
Which model were you using?
gpt-5.4 xhigh
What platform is your computer?
Linux 6.12.73+deb13-amd64 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
terminator 2.1.4 (on debian)
What issue are you seeing?
The agent ran a background command (cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings). The command finished execution and printed a compilation error to the terminal. However, the agent failed to detect the completion or read the output. Instead, it got stuck in an infinite loop, continuously logging • Waited for background terminal until I manually interrupted the process.
What steps can reproduce the bug?
Ask the agent to run a background command that results in a compilation error (in my case, cargo clippy).
The terminal successfully outputs the compilation error.
Observe the agent failing to read the output and continuously logging "Waited for background terminal".
Uploaded thread: 019cd87a-6be6-7662-8cec-0dfd3a6b6ee3
What is the expected behavior?
The agent should successfully detect when the background terminal process finishes, read the output (the compilation error), and proceed to analyze or fix the error instead of getting stuck in a waiting loop.
Additional information
_No response_
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Duplicate of #14303
Same issue, very annoying! Basically makes the agent not autonomous even though it suggests it's "watching". I have to babysit it all the time for sessions that are heavy on long compile time or test suite calls. There doesn't seem to be a way to make the call on the foreground anymore (thus blocking the agent, which automatically means it will act on it later). Seems to be a general issue either with GPT 5.4 and or the latest versions of Codex. I don't remember having this issue a few weeks ago with GPT 5.3 Codex.