github / github/copilot-cli

FLEET: session.task_complete does not fire after fleet execution

Đang mở
#2,262 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area:agents area:sessions
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

`session.task_complete` — which fires reliably after a normal `sendAndWait()` turn — **never fires** after fleet execution completes. There is no clean fleet-done signal.

## Steps to Reproduce

```javascript
const session = await client.createSession({
onPermissionRequest: async () => ({ approved: true }),
});

let taskCompleteCount = 0;
session.on('session.task_complete', () => taskCompleteCount++);

session.on('session.idle', () => {
console.log(`task_complete fired ${taskCompleteCount} times`);
// → "task_complete fired 0 times"
});

await session.rpc.fleet.start({ prompt: 'Research X and Y in parallel' });
```

## Observed Behaviour

`session.task_complete` fired **0 times** across all fleet runs. Spike data (2026-03-17) for a 4-subagent run with 757 total events:

```json
{
"session.background_tasks_changed": 172,
"subagent.started": 4,
"subagent.completed": 2,
"session.idle": 1,
"session.task_complete": 0
}
```

`session.task_complete` fires normally for regular `sendAndWait()` turns — fleet is the only case where it doesn't.

## Expected Behaviour

`session.task_complete` should fire when fleet finishes all sub-agents, consistent with regular turn behaviour. Alternatively, a dedicated `fleet.complete` event should be introduced.

## Workaround

Wait on `session.idle`, but see related issue FLEET-3 — `session.idle` fires before all sub-agents finish, making this imprecise.

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