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

Open 💬 2 comments Opened Aug 17, 2026 by yeapllg
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 10 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #38960
  • #38132

Powered by Codex Action

jdcodes1 · 10 days ago

Looked at the multi-agent wait machinery on main @ 1f41cc5d92 — 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":

https://github.com/openai/codex/blob/1f41cc5d92722748e45cae9cecc6d883a4e7cbb1/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs#L140-L156

(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 #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.