You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Infinite loop inspecting agent status and missing functions.exec tool with GPT-5.6 model #39004
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
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":
"{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:
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.
Make child death a completion of wait (terminal failure outcome) instead of an indistinguishable timeout.
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".
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.
Activity
github-actions commentedon Aug 17, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
jdcodes1 commentedon Aug 17, 2026
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.
waittells 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":codex/codex-rs/core/src/tools/handlers/multi_agents_v2/wait.rs
Lines 140 to 156 in 1f41cc5
(The
No agents completed yetline 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.execfixation 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 — noexec. A model instructed to verify progress, with no execution tool in its registry, inventingfunctions.execand 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:
list_agentsreads them); include whether each child is running/failed/never-started. A model that can see "child X failed to spawn" stops waiting for it.wait(terminal failure outcome) instead of an indistinguishable timeout.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.
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops
fix(code-mode): stop direct-tool routing loops