copilot-sdk icon indicating copy to clipboard operation
copilot-sdk copied to clipboard

Support for subagents and orchestration

Open ShrayRastogi opened this issue 10 months ago • 16 comments

GitHub Copilot Chat and VSCode supports custom agents to be used as subagents using the infer property set to true and “subagent” keyword in the instruction asking the GitHub copilot Chat agent to invoke a custom agent as a subagent.

Does GitHub Copilot SDK plan to support the same in future ? If so, what’s the timeline expected to release this feature? If no, then how does GitHub Copilot SDK plan to support Multi-agents? The SDK currently provides a way to define multiple custom agents in a copilot session, so how to invoke or use these multiple agents with each other?

What’s the support for Multi agent orchestration and Workflow orchestration in GitHub Copilot SDK?

ShrayRastogi avatar Jan 30 '26 19:01 ShrayRastogi

Thank you for opening this issue, @ShrayRastogi!

I've labeled this as enhancement and question since you're asking about future support for subagent orchestration features.

These are great questions about the SDK's roadmap for multi-agent capabilities. A maintainer will review and provide information about:

  • Plans for subagent support similar to VS Code's implementation
  • Multi-agent orchestration features
  • Timeline expectations

Your questions are clear and well-articulated, so no additional information is needed at this time.

AI generated by Issue Triage Agent

github-actions[bot] avatar Jan 30 '26 19:01 github-actions[bot]

@patniko @friggeri - Could you please help with any plan for this feature? This is a very important feature for building apps with copilot-sdk supporting multi-agent orchestration.

ShrayRastogi avatar Feb 05 '26 04:02 ShrayRastogi

I have the exact same questions and want this badly

Elliot-Construct avatar Feb 08 '26 09:02 Elliot-Construct

Same on my side, waiting for this support

matteo-ladrat-Legrand avatar Feb 13 '26 15:02 matteo-ladrat-Legrand

@patniko @friggeri - Could you please help with an update here?

ShrayRastogi avatar Feb 16 '26 06:02 ShrayRastogi

@ShrayRastogi I've just tested the integration of subagents using latest version of Github SDK in NodeJS and it successfully worked : Image

The custom agent was defined in the property customAgents when creating the session

matteo-ladrat-Legrand avatar Feb 18 '26 09:02 matteo-ladrat-Legrand

@matteo-ladrat-Legrand - Thanks for sharing. Yes, I also see that it works (with previous versions as well) but if you don't specify Tools and OnPermissionRequest handler (dotnet sdk) while creating the session. However, the question is more about orchestration rather than relying on copilot to route the requests based on intent.

Could you please share more on your sample though and the events - where are they captured?

ShrayRastogi avatar Feb 18 '26 10:02 ShrayRastogi

@SteveSandersonMS @friggeri @patniko - requesting an update here pls?

ShrayRastogi avatar Feb 18 '26 10:02 ShrayRastogi

@matteo-ladrat-Legrand - Thanks for sharing. Yes, I also see that it works (with previous versions as well) but if you don't specify Tools and OnPermissionRequest handler (dotnet sdk) while creating the session. However, the question is more about orchestration rather than relying on copilot to route the requests based on intent.

Could you please share more on your sample though and the events - where are they captured?

Here is the source code but I've truncated some text as it was just for testing purposes :

import { CopilotClient } from '@github/copilot-sdk'

const client = new CopilotClient({
    autoStart: true,
    autoRestart: false,
    logLevel: 'all',
});

async function main() {
    await client.start();

    const session = await client.createSession({
        model: "claude-sonnet-4.5",
        customAgents: [
            {
                name: "analyse-comments",
                description: "Analyse comments stored in a JSON file and generate a summary & statistics",
                prompt: `You role is to analyse comments stored in a JSON file and generate a summary & statistics. [...]`
            }
        ]
    })

    session.on(event => {
        console.log("==== Copilot Event ====")
        console.dir(event, { depth: 4 });
    })

    const response = await session.sendAndWait({
        prompt: "#useSubagent `analyse-comments` to analyse the content of the file `comments-export.json` and then generate message that can be shared to everyone based on the subagent output"
    }, 10 * 60_000);

    console.dir(response, { depth: 6 });
}

main();

matteo-ladrat-Legrand avatar Feb 18 '26 12:02 matteo-ladrat-Legrand

@matteo-ladrat-Legrand - Thanks for sharing. Yes, I also see that it works (with previous versions as well) but if you don't specify Tools and OnPermissionRequest handler (dotnet sdk) while creating the session. However, the question is more about orchestration rather than relying on copilot to route the requests based on intent. Could you please share more on your sample though and the events - where are they captured?

Here is the source code but I've truncated some text as it was just for testing purposes :

import { CopilotClient } from '@github/copilot-sdk'

const client = new CopilotClient({ autoStart: true, autoRestart: false, logLevel: 'all', });

async function main() { await client.start();

const session = await client.createSession({
    model: "claude-sonnet-4.5",
    customAgents: [
        {
            name: "analyse-comments",
            description: "Analyse comments stored in a JSON file and generate a summary & statistics",
            prompt: `You role is to analyse comments stored in a JSON file and generate a summary & statistics. [...]`
        }
    ]
})

session.on(event => {
    console.log("==== Copilot Event ====")
    console.dir(event, { depth: 4 });
})

const response = await session.sendAndWait({
    prompt: "#useSubagent `analyse-comments` to analyse the content of the file `comments-export.json` and then generate message that can be shared to everyone based on the subagent output"
}, 10 * 60_000);

console.dir(response, { depth: 6 });

}

main();

Thank you @matteo-ladrat-Legrand for the sample.

ShrayRastogi avatar Feb 19 '26 04:02 ShrayRastogi

Running into this exact gap. I have agents on Claude Code, Cursor, and Codex that need to coordinate, but there's no cross-provider orchestration layer. Each SDK assumes it's the only agent runtime.

We built a provider-agnostic coordination layer that uses filesystem-based messaging - any agent from any SDK can read/write to a shared inbox directory. It's crude compared to native SDK support, but it means a Copilot agent can hand off work to a Claude agent without either knowing the other's internals. Packaged it as ide-agent-kit if anyone's experimenting with similar cross-SDK setups.

ThinkOffApp avatar Feb 23 '26 17:02 ThinkOffApp

Hi how would one hook into the event life cycle of sub agents say if i wanted to create a agent tree? also how can you say what its system prompt is etc.

RollsChris avatar Feb 28 '26 17:02 RollsChris

@RollsChris The agent tree visibility is exactly what we focused on too. In our setup, every agent action gets logged to a receipt file with the agent identity, so you can reconstruct the full tree after the fact.

For the lifecycle hooks question, we handle it through the message layer. When an agent starts, finishes, or hits a blocker, it posts to the shared room. Other agents (or a monitoring dashboard) can subscribe to those events and react. Not as tight as native SDK lifecycle callbacks, but it works across different SDKs and models.

If you want to try it, the coordination layer is open source: https://github.com/ThinkOffApp/ide-agent-kit. The receipt log and room events give you the agent tree view you are describing.

ThinkOffApp avatar Mar 01 '26 16:03 ThinkOffApp

We've shipped agent orchestration in IDE Agent Kit v0.4.0. It adds ACP session management, filesystem message bus, and webhook relay for coordinating sub-agents across IDEs. Token-gated, allowlisted, with audit trail. Tested with 3 IDEs and 7 agents. Available on ClawHub and npm.

ThinkOffApp avatar Mar 02 '26 13:03 ThinkOffApp

Added multiple guides explaining how to work with subagents. Feel free to reopen or add a new issue if there are other features requested.

patniko avatar Mar 12 '26 02:03 patniko

For anyone landing here looking for deterministic orchestration rather than model-directed #useSubagent routing, I built a community orchestration layer on top of the Python GitHub Copilot SDK:

https://github.com/kody-w/rapp-dynamic-workflows

pip install git+https://github.com/kody-w/rapp-dynamic-workflows.git
from pydantic import BaseModel

class Review(BaseModel):
    approve: bool
    summary: str

async def workflow(wf):
    reviews = await wf.parallel([
        lambda: wf.agent("Review for correctness.", schema=Review, label="correctness"),
        lambda: wf.agent("Review for security.", schema=Review, label="security"),
    ])

The Copilot SDK remains the agent runtime; rapp-dynamic-workflows supplies the deterministic control plane:

  • plain-Python agent, parallel, pipeline, and phase composition;
  • one isolated Copilot session per agent over a shared CopilotClient;
  • Pydantic/JSON-schema-validated results via a forced submit tool;
  • branch failure isolation, concurrency limits, timeouts, and run safety caps;
  • run-wide AI-credit accounting/admission control with per-session caps;
  • append-only journals with content-addressed replay, so interrupted runs resume completed work instead of respawning it;
  • progress, usage statistics, optional transcripts, adversarial verification, and judge-panel patterns.

This is MIT-licensed and unofficial. It does not change the SDK's native subagent behavior; it addresses the other half of the request in this issue: application-controlled multi-agent and workflow orchestration where the model does not improvise the topology.

kody-w avatar Jul 22 '26 00:07 kody-w