FLEET: No fleet.* lifecycle events — fleet state must be inferred from subagent.* events
- 主要語言
- Shell
- 星號
- 11.2k
- 分支
- 1.9k
- 平均合併
- 14 小時 16 分鐘
- 30 天內合併 PR
- 6
描述
## 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:
```javascript
// 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
```json
{ "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
```typescript
// 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
貢獻指南
評估
這個 Issue 還沒有評估資料。