Skip to content

FLEET: No fleet.* lifecycle events — fleet state must be inferred from subagent.* events #2264

@darthmolen

Description

@darthmolen

Summary

There are no fleet.started, fleet.complete, or fleet.failed events. Fleet's entire lifecycle must be reconstructed by correlating subagent.* events — and session.background_tasks_changed fires 100+ times with empty {} payload, providing no actionable information.

Observed Event Flow

A complete fleet run (4 sub-agents, 757 events) produced this lifecycle:

user.message
assistant.turn_start
  tool.execution_start    ← fleet invocation (indistinguishable from any tool call)
  tool.execution_complete
  subagent.started        ← only signal fleet is running
  subagent.started
  subagent.started
  subagent.started
  [172× session.background_tasks_changed — all with data: {}]
  [tool.execution_start/complete per subagent]
  subagent.completed
  subagent.completed
  assistant.message       ← aggregated result
assistant.turn_end
session.idle

No fleet.started. No fleet.complete. No fleet.failed.

Problem 1: Cannot distinguish fleet from other sub-agent dispatch

Fleet and the task built-in tool both dispatch sub-agents with identical event signatures. Callers cannot tell which mechanism was used:

// Both produce identical subagent.started events:
await session.rpc.fleet.start({ prompt: 'Research X' });      // explicit fleet
await session.sendAndWait({ prompt: 'Research X' });           // model may call task()

Problem 2: session.background_tasks_changed fires 172× with empty payload

{ "type": "session.background_tasks_changed", "data": {} }

This event fires on every state change (~14× per sub-agent pair) but carries no information about what changed, how many tasks are running, or which agents are active.

Requested Addition

// New events:
fleet.started  { prompt: string; agentCount?: number; toolCallId: string }
fleet.complete { toolCallId: string; agentCount: number; failedCount: number; durationMs: number }
fleet.failed   { toolCallId: string; error: string }

// background_tasks_changed improvement:
session.background_tasks_changed { activeTasks: number; agentNames?: string[] }

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