Skip to content

Custom Agents are not working | Node | Dotnet #251

@ShrayRastogi

Description

@ShrayRastogi

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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions