Describe the bug
The wait_agent tool returns sub-agent output as raw streaming tokens (individual token-by-token updates) rather than a coherent accumulated response. This causes the parent agent to see garbled or empty content and incorrectly close the sub-agent.
Root cause
Investigation of the rollout file rollout-2026-06-30T08-43-32Z-019f17b2-a79e-7502-837c-974b4cd08a1d.jsonl at lines 17-18 shows that wait_agent output is being serialized as streaming token deltas instead of the final assembled output.
Impact
- The parent agent calls
wait_agent but receives token-by-token incremental output
- Unable to read reasoning content or process output properly
- The agent interprets the empty/unreadable response as "sub-agent not responding" and prematurely calls
close_agent
- This effectively breaks the sub-agent orchestration flow
Expected behavior
wait_agent should return the fully accumulated final output of the sub-agent (or a well-defined progress status), not streaming token deltas.
Related components
crates/tools/src/coordinator.rs — wait_agent handler
crates/core/src/tools/ — tool definitions
Describe the bug
The
wait_agenttool returns sub-agent output as raw streaming tokens (individual token-by-token updates) rather than a coherent accumulated response. This causes the parent agent to see garbled or empty content and incorrectly close the sub-agent.Root cause
Investigation of the rollout file
rollout-2026-06-30T08-43-32Z-019f17b2-a79e-7502-837c-974b4cd08a1d.jsonlat lines 17-18 shows thatwait_agentoutput is being serialized as streaming token deltas instead of the final assembled output.Impact
wait_agentbut receives token-by-token incremental outputclose_agentExpected behavior
wait_agentshould return the fully accumulated final output of the sub-agent (or a well-defined progress status), not streaming token deltas.Related components
crates/tools/src/coordinator.rs— wait_agent handlercrates/core/src/tools/— tool definitions