Skip to content

Infinite loop inspecting agent status and missing functions.exec tool with GPT-5.6 model #39004

Open

Description

@yeapllg

What version of Codex CLI is running?

0.147

What subscription do you have?

Pay-as-you-go

Which model were you using?

5.6 sol

What platform is your computer?

No response

What terminal emulator and version are you using (if applicable)?

No response

Codex doctor report

What issue are you seeing?

The agent gets stuck in an infinite loop checking for "No agents completed yet" and investigating "functions.exec" when using the gpt-5.6 model. The task never completes and no error message is returned.

What steps can reproduce the bug?

• Inspecting process status and files
• Checking process completion status
• Finished waiting
└ No agents completed yet
• Planning process verification
• Investigating missing functions.exec tool
• Finished waiting
└ No agents completed yet
• Investigating missing exec tool usage
• Verifying hidden functions.exec availability
• Testing direct functions.exec usage
• Finished waiting
└ No agents completed yet
• Investigating dynamic availability of functions.exec
• Reimplementing missing functions.exec definition
• Verifying dynamic tool execution

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    subagentIssues involving subagents or multi-agent features
    tool-callsIssues related to tool calling
    on Aug 17, 2026
  2. github-actions commented on Aug 17, 2026

    @github-actions
    Contributor
  3. jdcodes1 commented on Aug 17, 2026

    @jdcodes1

    Looked at the multi-agent wait machinery on main @ 1f41cc5 — the loop you captured is close to the rational model response to what the tools actually return, which makes this fixable at the tool layer rather than the model layer.

    1. wait tells the model nothing on timeout. The v2 wait handler returns, in total, {"message": "Wait timed out.", "timed_out": true} — no per-agent states, no distinction between "children are working", "children are stuck", and "children died":

    ) -> Self {
    let message = match outcome {
    WaitOutcome::MailboxActivity => "Wait completed.",
    WaitOutcome::Steered => "Wait interrupted by new input.",
    WaitOutcome::TimedOut => "Wait timed out.",
    };
    let message = match requested_timeout_ms {
    Some(requested_timeout_ms) if requested_timeout_ms < timeout_ms => format!(
    "{message}\n\nRequested timeout of {requested_timeout_ms}ms was clamped to the minimum of {timeout_ms}ms."
    ),
    Some(_) | None => message.to_string(),
    };
    Self {
    message,
    timed_out: outcome == WaitOutcome::TimedOut,
    }
    }

    (The No agents completed yet line in your transcript is the TUI's rendering of the empty agent-state map — tui/src/multi_agents.rs#L590 — not information the model can act on.) A model whose children never complete gets an endless series of indistinguishable timeouts, so "wait → inspect → wait" repeats forever; there's no terminal state for it to observe and no loop-breaker in the harness (no cap on consecutive no-progress waits).

    2. The functions.exec fixation matches a real tool-registration gap, not just hallucination. #38960 (which the dedup bot linked) reports that the parent session in this configuration exposes only wait + collaboration tools — no exec. A model instructed to verify progress, with no execution tool in its registry, inventing functions.exec and then "reimplementing" it is exactly the failure shape you'd expect from that gap. Your transcript is effectively #38960's missing-exec plus the wait-starvation above compounding each other.

    Fix outline:

    1. Enrich the wait timeout result with a per-agent status snapshot (the states already exist — list_agents reads them); include whether each child is running/failed/never-started. A model that can see "child X failed to spawn" stops waiting for it.
    2. Make child death a completion of wait (terminal failure outcome) instead of an indistinguishable timeout.
    3. Harness-side loop-breaker: after N consecutive timed-out waits with zero agent-state change, fail the turn with a user-visible error rather than letting the loop burn tokens silently — your report's core harm is that "no error message is returned".
    4. Close the parent-session registry gap tracked in Windows Desktop 0.148-alpha.9: parent /root session has no exec, only wait + collaboration tools #38960 so verification work has a real tool instead of a phantom one.

    Also related for the maintainers triaging: #38989 documents runaway delegation in the same multi-agent v2 surface — (3) would bound the damage of that class too.

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

    CLIIssues related to the Codex CLIbugSomething isn't workingsubagentIssues involving subagents or multi-agent featurestool-callsIssues related to tool calling

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions