Skip to content

FLEET: session.task_complete does not fire after fleet execution #2262

Open

Description

@darthmolen

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

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:

{
  "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

Activity

  1. added
    area:sessionsSession management, resume, history, session picker, and session state
    on Apr 6, 2026
  2. added
    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agents
    on Apr 6, 2026
  3. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the report. We've shipped fixes in this area since this was filed (most recently in Copilot CLI v1.0.93), and we believe this may now be resolved. Could you retest on the latest release (Copilot CLI v1.0.103) and let us know whether you still see it? If we don't hear back in a couple of weeks, we may close this issue — you can always reopen it.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsSub-agents, fleet, autopilot, plan mode, background agents, and custom agentsarea:sessionsSession management, resume, history, session picker, and session statemore-info-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions