github / github/copilot-cli

FLEET: fleet.start() ignores customAgents — always dispatches built-in agent types

Aperta
#2,261 1 commento 1 reazione 0 assegnatari Vedi su GitHub
area:agents
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

## Summary

When a session is created with `customAgents` defined, calling `rpc.fleet.start()` **ignores the registered custom agents entirely**. Sub-agents are dispatched as built-in types (`explore`, `general-purpose`, etc.), never as the custom agents registered in the session config.

## Steps to Reproduce

```javascript
const session = await client.createSession({
onPermissionRequest: async () => ({ approved: true }),
customAgents: [{
name: 'my-researcher',
displayName: 'My Researcher',
description: 'A custom agent that only reads files.',
prompt: 'You are a focused research agent. Only read files.',
tools: ['view', 'grep'],
infer: false,
}],
});

// Confirm registered:
const agentList = await session.rpc.agent.list();
// → { agents: [{ name: 'my-researcher', ... }] } ✓ registered

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

session.on('subagent.started', (data) => {
console.log(data.agentName);
// → 'explore' ← always built-in, never 'my-researcher'
});
```

## Observed Behaviour

Fleet dispatches `explore` built-ins regardless of `customAgents` config. The custom agent is visible in `rpc.agent.list()` immediately before the fleet call, confirming registration is not the issue.

Spike data (2026-03-17):
```json
{
"agentNamesObserved": ["explore", "explore"],
"subagentCount": 2,
"answer": "PARTIAL — dispatched built-in names, not custom names"
}
```

## Expected Behaviour

One of:
1. `fleet.start()` uses custom agents when registered in the session
2. `fleet.start()` accepts `agentNames: string[]` to specify which agents to dispatch
3. Documentation clarifies fleet only uses built-in types (so callers know not to expect otherwise)

## Impact

- Custom agent tool restrictions (`customAgents[n].tools`) cannot be applied to fleet workers
- Custom system prompts are ignored during fleet
- Fleet workers always get unrestricted built-in agent capabilities regardless of session config

## Environment

- SDK: `@github/copilot-sdk` v0.1.32
- CLI: latest
- Node: v24.13.1

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reproducing the session setup with customAgents, then inspect the fleet.start, agent.list, and subagent.started entry points described in the issue. Confirm whether fleet should dispatch registered custom names, accept explicit agentNames, or document built-in-only behavior; done requires an agreed behavior and verification that the observed subagent names and custom restrictions match it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, node.js
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Tranquilla
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.