Skip to content
Draft
Show file tree
Hide file tree
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
56 changes: 28 additions & 28 deletions nodejs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@github/copilot": "^0.0.394",
"@github/copilot": "^0.0.399",
"vscode-jsonrpc": "^8.2.1",
"zod": "^4.3.5"
},
Expand Down
53 changes: 53 additions & 0 deletions nodejs/test/e2e/mcp-and-agents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,59 @@ describe("MCP Servers and Custom Agents", async () => {
expect(session.sessionId).toBeDefined();
await session.destroy();
});

it("should surface custom agents to the assistant for listing", async () => {
const customAgents: CustomAgentConfig[] = [
{
name: "sdk-test-agent",
displayName: "SDK Test Agent",
description: "A custom test agent configured via SDK",
prompt: "You are a helpful test agent.",
infer: true,
},
];

const session = await client.createSession({
customAgents,
});

expect(session.sessionId).toBeDefined();

// Ask the assistant to list custom agents
// The assistant should be able to see and mention the custom agent
const message = await session.sendAndWait({
prompt: "What custom agents are available? List them with their names and descriptions.",
});

// The response should mention the custom agent we defined
expect(message?.data.content).toBeDefined();
const content = message.data.content;

// Check that the custom agent is actually surfaced in the response
// We look for the agent name along with its description to ensure
// the agent information is being properly displayed, not just mentioned generically
const contentLowercase = content.toLowerCase();
const hasAgentName =
contentLowercase.includes("sdk-test-agent") ||
contentLowercase.includes("sdk test agent");
const hasAgentDescription =
contentLowercase.includes("custom test agent") ||
contentLowercase.includes("configured via sdk");

// At minimum, the agent name should be present
expect(hasAgentName).toBe(true);

// Ideally, the description should also be present, indicating full surfacing
// Note: This may fail if the model doesn't include full details, but
// the agent name being present confirms basic visibility
if (!hasAgentDescription) {
console.warn(
"Custom agent name found but description not included in response. This may indicate partial surfacing."
);
}

await session.destroy();
});
});

describe("Combined Configuration", () => {
Expand Down
56 changes: 28 additions & 28 deletions test/harness/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/harness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test": "vitest run"
},
"devDependencies": {
"@github/copilot": "^0.0.394",
"@github/copilot": "^0.0.399",
"@types/node": "^25.0.3",
"openai": "^6.15.0",
"tsx": "^4.21.0",
Expand Down
Loading