MultiAgentV2: child stalls after task_started and Windows TUI exits during wait_agent

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

Summary

On Codex CLI 0.146.0 for Windows, MultiAgentV2 can report a successful spawn_agent, create one durable parent→child edge, and emit Started, but the child records only session_meta + task_started and performs no model work. When the parent immediately calls wait_agent, the Codex TUI exits back to the PowerShell prompt without a tool result or error.

This reproduced twice. In both reproductions the UI also printed the same Started <agent_path> line twice, even though the parent rollout and SQLite state prove there was only one spawn call and one child.

Environment

  • Codex CLI: 0.146.0
  • Model: gpt-5.6-sol
  • Multi-agent: V2 native collaboration.spawn_agent / wait_agent
  • OS: Windows
  • Terminal: PowerShell
  • Child: registered lazycodex-gate-reviewer role, same OpenAI provider
  • Spawn mode: fork_turns: "none"
  • Parent and child use the same unchanged workspace/revision

Reproduction

  1. Start a fresh Codex CLI parent session.
  2. As the first and only child, call spawn_agent with a non-empty task message, a unique task name, a registered child role, and fork_turns: "none".
  3. Observe that spawn_agent returns success with the canonical task name.
  4. Observe that the TUI prints the same Started /root/<task> line twice.
  5. Immediately call wait_agent.
  6. The TUI exits to the PowerShell prompt. There is no wait_agent function output.

Reproduction evidence

Two independent failed children:

| Run | Topology | Child durable state | Parent final event |
|---|---|---|---|
| A | second sequential child, after a successful child | edge open; tokens_used=0; rollout contains only session_meta, task_started | wait_agent function call, no output |
| B | first and only child in a fresh parent | edge open; tokens_used=0; rollout contains only session_meta, task_started | wait_agent function call, no output |

Control: the first child in Run A used the same registered role/provider and completed normally with multiple wait_agent results and a final task_complete.

For Run B:

  • Parent rollout has exactly one spawn_agent function call.
  • thread_spawn_edges has exactly one row for the parent and child.
  • Child rollout has exactly two records: session_meta and event_msg.task_started.
  • Parent rollout ends at the wait_agent function call; no function_call_output, turn_aborted, or surfaced error follows.
  • UI showed Started /root/<task> twice.

This rules out duplicate model/tool invocation as the reason for the duplicated line.

Expected behavior

  • The child should consume the non-empty task and start model work.
  • wait_agent should return mailbox activity or a timeout; it must not terminate the TUI.
  • A single spawn activity should render one Started line.
  • If initial child dispatch fails, spawn_agent should return an error and should not leave an open durable edge / zero-token orphan.

Actual behavior

  • spawn_agent reports success.
  • The child reaches task_started but never produces any further event.
  • The durable edge remains open.
  • The TUI duplicates the Started line.
  • The parent process exits while wait_agent is in flight.

Current-source observations

Checked against main commit b2dc8b3:

  • V2 spawn awaits spawn_agent_with_communication and then emits SubAgentActivityKind::Started: spawn.rs.
  • The control path creates/notifies/persists the child before sending initial inter-agent communication, then returns a LiveAgent: control/spawn.rs.
  • V2 wait_agent awaits input-queue activity and should convert a closed receiver or timeout to a normal result: wait.rs.
  • TUI activity handling appends every received subagent activity history cell without an obvious idempotency guard: tool_lifecycle.rs.

Likely investigation points are: initial communication enqueue/turn startup after the durable edge is committed, fatal error propagation while wait_agent is in flight, and TUI deduplication keyed by the activity item id/kind.

Related but not duplicate

  • #16900 — parent-visible wait/liveness contract
  • #19197 — persistent orphaned subagents and eventual freezes
  • #25426 — close_agent can hang on non-terminating child
  • #18335 — leaked spawn slots across turns

I can provide sanitized rollout excerpts or a small SQLite query/result if maintainers want additional evidence.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 24 days ago

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

  • #36012

Powered by Codex Action

mychox68 · 24 days ago

Closing as a duplicate of #36012. The fresh-parent reproduction, single-spawn/duplicate-Started evidence, and successful same-environment control have been added to #36012.