Skip to content

Agent stuck on "Waited for background terminal" after command finishes #14314

Open

Description

@no1x0

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

Activity

  1. added
    CLIIssues related to the Codex CLI
    tool-callsIssues related to tool calling
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on Mar 11, 2026
  2. no1x0 commented on Mar 11, 2026

    @no1x0
    Author

    Duplicate of #14303

  3. added
    agentIssues related to the core agent loop
    and removed
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    CLIIssues related to the Codex CLI
    tool-callsIssues related to tool calling
    on Mar 11, 2026
  4. fullofcaffeine commented on Mar 11, 2026

    @fullofcaffeine

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentIssues related to the core agent loopbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions