Skip to content

FLEET: Sub-agent output not streamed per-agent — results aggregated and delivered only at end #2265

@darthmolen

Description

@darthmolen

Summary

Sub-agent tool activity streams in real time, but each sub-agent's output text does not. A single aggregated assistant.message arrives after all sub-agents complete. There is no way to surface individual sub-agent results progressively.

Observed Behaviour

From a 4-sub-agent fleet run (~176 seconds total):

{
  "tool.execution_start": 110,
  "tool.execution_complete": 110,
  "subagent.started": 4,
  "subagent.completed": 2,
  "assistant.message": 57,
  "session.idle": 1
}

The 110 tool execution pairs stream in real time — you can observe agents working. But assistant.message content is not correlated to a specific sub-agent, and no sub-agent output arrives until all agents complete.

Problem for UI Builders

t=0s    Fleet starts, 4 agents running
t=0-60s Tool events stream (grep, view calls visible)
t=60s   subagent.completed fires for agent 1
          → No output. What did agent 1 find?
t=75s   agent 2 completes
t=90s   agent 3 completes
t=105s  agent 4 completes
t=110s  assistant.message arrives — all 4 results at once

Tool calls can be attributed to sub-agents via parentToolCallId, but output text cannot:

// Works: attribute tool calls to agents
session.on('tool.execution_complete', (d) => {
    if (d.parentToolCallId) {
        // d.parentToolCallId matches a subagent.started toolCallId
    }
});

// Broken: assistant.message has no parentToolCallId
session.on('assistant.message', (d) => {
    // d.data has no subagentToolCallId — cannot attribute to any agent
});

Requested Change

assistant.message events emitted during fleet should carry a subagentToolCallId field, or a new subagent.message event should be introduced:

session.on('subagent.message', (data: {
    toolCallId: string;    // matches subagent.started
    agentName: string;
    content: string;
    isComplete: boolean;   // false = streaming delta, true = agent done
}) => { ... });

Environment

  • SDK: @github/copilot-sdk v0.1.32
  • CLI: latest
  • Node: v24.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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