Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions tutorial/lessons/16-agent-delegation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ What subagents are and why they exist — the execution model behind everything

## Concepts

> **"Delegation" means three different things in this lesson:** spinning up a **subagent** (the main focus below), chaining custom agents into a **pipeline**, and full handoff to a cloud runner via **`/delegate`**. Keep them distinct as you read.

### Subagents: what's actually happening under the hood

When you ask Copilot something complex, it sometimes delegates pieces of work to **subagents** — separate AI processes with their own context windows that run independently and report back. You may have noticed this already: indented exploration steps, parallel investigations, tool calls happening before Copilot gives you an answer.
Expand Down Expand Up @@ -62,9 +64,20 @@ Copilot may choose to use subagents automatically on complex requests, but the m
"Use a subagent to check whether validators.ts and tasks.ts are consistent."
```

**3. Match a custom agent's description** — if your prompt closely matches the `description` field of a custom agent, Copilot will often invoke it automatically. Well-written descriptions are what make this work reliably.
**3. Match a custom agent's description** — if your prompt closely matches the `description` field of a custom agent, Copilot will often invoke it automatically (this is the `infer: true` auto-delegation introduced in Lesson 12). Well-written descriptions are what make this work reliably.

> **Note:** All three approaches above run subagents *inside your current session*. To hand the whole request to a separate cloud runner instead, see "Full delegation with `/delegate`" below, which is a different mechanism rather than a subagent trigger.

### Full delegation with `/delegate`

`/delegate` is **not** a way to trigger a subagent. It hands off your *entire* request to a **cloud agent runner** (a fresh, separate execution environment) rather than spinning up an isolated subagent within your current session.

**4. Fully delegate with `/delegate`** — hands off the entire request to a cloud agent runner. Useful for simpler, well-scoped tasks that benefit from a fresh context.
| | Subagent | `/delegate` |
|---|----------|-------------|
| Runs where | Your current session | Separate cloud runner |
| Scope | A slice of the work, reported back | The whole request |
| Context | Isolated window, same session | Entirely fresh environment |
| Best for | Parallel exploration, specialist hand-offs | Simpler, well-scoped tasks that benefit from a clean slate |

### Agent pipelines: `tools: ["agent"]`

Expand Down
Loading