Skip to content

Agent Runtime: Wait agent output returned as raw streaming tokens — makes agent think sub-agent is unresponsive #138

Description

@wangtsiao

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions