Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Custom agents defined via the SDK were not visible to the assistant when queried. The assistant would only list built-in agents (explore, task, general-purpose, code-review) despite custom agents being configured.

Changes

  • Updated CLI dependency: @github/copilot from 0.0.394 to 0.0.398

    • nodejs/package.json
    • test/harness/package.json
  • Added test coverage: Integration test verifies custom agents surface in assistant responses

Context

CLI 0.0.398 properly wires custom agents into the task tool description. The GAl function now correctly retrieves session custom agents (filtered by infer !== false) and passes them to xqILqI which formats the "User-provided custom agents:" section in the system prompt.

Example

This now works as expected:

const session = await client.createSession({
  customAgents: [{
    name: "test-agent",
    displayName: "Test Agent", 
    description: "A test agent for SDK testing",
    prompt: "You are a helpful test agent.",
    infer: true,
  }]
});

await session.sendAndWait({ 
  prompt: "List all custom agents" 
});
// Assistant now includes "test-agent" in response
Original prompt

This section details on the original issue you should resolve

<issue_title>Custom Agents are not working | Node | Dotnet</issue_title>
<issue_description>Session created with Custom Agents are initialized but when asked about listing custom agents, the assistant is not aware of any custom agents available.

Tried with both node and dotnet SDKs. Do custom agents need special configuration?

const customAgents: CustomAgentConfig[] = [
    {
        name: "test-agent",
        displayName: "Test Agent",
        description: "A test agent for SDK testing",
        prompt: "You are a helpful test agent.",
        infer: true,
    },
];

const client = new CopilotClient();
const session = await client.createSession({
    model: "gpt-5.2",
    streaming: true,
    //tools: [getWeather],
    customAgents: customAgents,
    onPermissionRequest: (request, invocation) => {
        console.log(`Tool permission requested: ${request.kind}`);
        console.log(`Tool details: ${JSON.stringify(request)}`);

        let result: PermissionRequestResult = { kind: "approved" };
        rl.question("Allow (y/n)?", (answer) => {
            if (answer.toLowerCase() !== "y") {
                result = { kind: "denied-interactively-by-user"}
            }
        });
        return result;
    }
});


const prompt = () => {
    rl.question("You: ", async (input) => {
        if (input.toLowerCase() === "exit") {
            await client.stop();
            rl.close();
            return;
        }

        process.stdout.write("Assistant: ");
        await session.sendAndWait({ prompt: "List all custom agents" });
        console.log("\n");
        prompt();
    });
};

Output -

You: list all custom agents
Assistant: I’ll pull the Copilot CLI help/docs and extract the list of available custom agents.The Copilot CLI ships with these built-in (custom) agents:

- **explore**
- **task**
- **general-purpose**
- **code-review**

If you mean *user-defined* custom agents (from `/skills` or MCP/plugin configuration), run **`/agent`** to browse what’s currently installed/available in your setup.

</issue_description>

<agent_instructions>Confirm we surface the right context from CLI to support this scenario.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits January 29, 2026 17:57
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
Co-authored-by: patniko <26906478+patniko@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix custom agents not initializing correctly Fix custom agents visibility by updating CLI to 0.0.398 Jan 29, 2026
Copilot AI requested a review from patniko January 29, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Agents are not working | Node | Dotnet

2 participants