github / github/copilot-cli

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

Đang mở
#2,264 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agents
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

## 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.