From ce37dee3d07d208f275c266af0b22115dd3a4de1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 17:49:47 +0000 Subject: [PATCH 1/8] Initial plan From 0ff6a0f31ac4f4768de321cd7aee17a2efbdea55 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 17:57:31 +0000 Subject: [PATCH 2/8] Update CLI dependency to 0.0.398 Co-authored-by: patniko <26906478+patniko@users.noreply.github.com> --- nodejs/package-lock.json | 56 +++++++++++++++++----------------- nodejs/package.json | 2 +- test/harness/package-lock.json | 56 +++++++++++++++++----------------- test/harness/package.json | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index 6c2bb94f..c1f78b98 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^0.0.394", + "@github/copilot": "^0.0.398", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.5" }, @@ -662,26 +662,26 @@ } }, "node_modules/@github/copilot": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.394.tgz", - "integrity": "sha512-koSiaHvVwjgppgh+puxf6dgsR8ql/WST1scS5bjzMsJFfWk7f4xtEXla7TCQfSGoZkCmCsr2Tis27v5TpssiCg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.398.tgz", + "integrity": "sha512-Yqma05bNQmgzC2p1JvS0m4kIl+IxqdS/XJ3kvtZxIJiXNpzsuvqxfLfjEF1J7M5JFcQxDjLt4QbVN4kY4KvlMQ==", "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "0.0.394", - "@github/copilot-darwin-x64": "0.0.394", - "@github/copilot-linux-arm64": "0.0.394", - "@github/copilot-linux-x64": "0.0.394", - "@github/copilot-win32-arm64": "0.0.394", - "@github/copilot-win32-x64": "0.0.394" + "@github/copilot-darwin-arm64": "0.0.398", + "@github/copilot-darwin-x64": "0.0.398", + "@github/copilot-linux-arm64": "0.0.398", + "@github/copilot-linux-x64": "0.0.398", + "@github/copilot-win32-arm64": "0.0.398", + "@github/copilot-win32-x64": "0.0.398" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.394.tgz", - "integrity": "sha512-qDmDFiFaYFW45UhxylN2JyQRLVGLCpkr5UmgbfH5e0aksf+69qytK/MwpD2Cq12KdTjyGMEorlADkSu5eftELA==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.398.tgz", + "integrity": "sha512-Qj352LtW5Uw+Zk3VR1igvYpizKToIzPD8nVyvM2I4Coxudnrcc+GggstYZwNhvfhj7WbAnDLqfaIJR20TD986A==", "cpu": [ "arm64" ], @@ -695,9 +695,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.394.tgz", - "integrity": "sha512-iN4YwSVFxhASiBjLk46f+AzRTNHCvYcmyTKBASxieMIhnDxznYmpo+haFKPCv2lCsEWU8s5LARCnXxxx8J1wKA==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.398.tgz", + "integrity": "sha512-Eghf9+4xgVMe6q1Tur1AktPS2C2AggmTCFZQeE7ljXzwtj82obOlyX2yslOlPgUgu2XjKJ3zW1r3KCJGjXAvmw==", "cpu": [ "x64" ], @@ -711,9 +711,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.394.tgz", - "integrity": "sha512-9NeGvmO2tGztuneXZfYAyW3fDk6Pdl6Ffg8MAUaevA/p0awvA+ti/Vh0ZSTcI81nDTjkzONvrcIcjYAN7x0oSg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.398.tgz", + "integrity": "sha512-iQmMcIosCEPk1Sb3502TR0PMSQ1OV6NVHFbg3jX8nlbea4qgL1SrkANecHZjSpcc77glKUAP9+zY2U3pv545Hw==", "cpu": [ "arm64" ], @@ -727,9 +727,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.394.tgz", - "integrity": "sha512-toahsYQORrP/TPSBQ7sxj4/fJg3YUrD0ksCj/Z4y2vT6EwrE9iC2BspKgQRa4CBoCqxYDNB2blc+mQ1UuzPOxg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.398.tgz", + "integrity": "sha512-v0SMz8cIlR0nI7CzkoHjwQhrYKEpB84kH/GxcD10T+L+EVQDQL2HO0TS1tHcB9FA88qD+/HE6bd0NzKXKSRPng==", "cpu": [ "x64" ], @@ -743,9 +743,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.394.tgz", - "integrity": "sha512-R7XBP3l+oeDuBrP0KD80ZBEMsZoxAW8QO2MNsDUV8eVrNJnp6KtGHoA+iCsKYKNOD6wHA/q5qm/jR+gpsz46Aw==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.398.tgz", + "integrity": "sha512-IGcburUp/vyzGtySqP/HgmxznzLsxFL/+AtPShjTNKydwh5Y23nq2y7XQZK39SgHppN8GiVNHCpNrzNykGZNOQ==", "cpu": [ "arm64" ], @@ -759,9 +759,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.394.tgz", - "integrity": "sha512-/XYV8srP+pMXbf9Gc3wr58zCzBZvsdA3X4poSvr2uU8yCZ6E4pD0agFaZ1c/CikANJi8nb0Id3kulhEhePz/3A==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.398.tgz", + "integrity": "sha512-PBm2D8lxe8Gipgk0x6i2/kQhpoRzYk6ojFFhhBrZBF7fPK+iWFDQzloahXHQQ4/E7cXP64DqT21oiWC9HHKMrg==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index 887bac91..fb8eb881 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -40,7 +40,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^0.0.394", + "@github/copilot": "^0.0.398", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.5" }, diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index e5624654..11cdb42b 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^0.0.394", + "@github/copilot": "^0.0.398", "@types/node": "^25.0.3", "openai": "^6.15.0", "tsx": "^4.21.0", @@ -461,27 +461,27 @@ } }, "node_modules/@github/copilot": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.394.tgz", - "integrity": "sha512-koSiaHvVwjgppgh+puxf6dgsR8ql/WST1scS5bjzMsJFfWk7f4xtEXla7TCQfSGoZkCmCsr2Tis27v5TpssiCg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.398.tgz", + "integrity": "sha512-Yqma05bNQmgzC2p1JvS0m4kIl+IxqdS/XJ3kvtZxIJiXNpzsuvqxfLfjEF1J7M5JFcQxDjLt4QbVN4kY4KvlMQ==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "0.0.394", - "@github/copilot-darwin-x64": "0.0.394", - "@github/copilot-linux-arm64": "0.0.394", - "@github/copilot-linux-x64": "0.0.394", - "@github/copilot-win32-arm64": "0.0.394", - "@github/copilot-win32-x64": "0.0.394" + "@github/copilot-darwin-arm64": "0.0.398", + "@github/copilot-darwin-x64": "0.0.398", + "@github/copilot-linux-arm64": "0.0.398", + "@github/copilot-linux-x64": "0.0.398", + "@github/copilot-win32-arm64": "0.0.398", + "@github/copilot-win32-x64": "0.0.398" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.394.tgz", - "integrity": "sha512-qDmDFiFaYFW45UhxylN2JyQRLVGLCpkr5UmgbfH5e0aksf+69qytK/MwpD2Cq12KdTjyGMEorlADkSu5eftELA==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.398.tgz", + "integrity": "sha512-Qj352LtW5Uw+Zk3VR1igvYpizKToIzPD8nVyvM2I4Coxudnrcc+GggstYZwNhvfhj7WbAnDLqfaIJR20TD986A==", "cpu": [ "arm64" ], @@ -496,9 +496,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.394.tgz", - "integrity": "sha512-iN4YwSVFxhASiBjLk46f+AzRTNHCvYcmyTKBASxieMIhnDxznYmpo+haFKPCv2lCsEWU8s5LARCnXxxx8J1wKA==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.398.tgz", + "integrity": "sha512-Eghf9+4xgVMe6q1Tur1AktPS2C2AggmTCFZQeE7ljXzwtj82obOlyX2yslOlPgUgu2XjKJ3zW1r3KCJGjXAvmw==", "cpu": [ "x64" ], @@ -513,9 +513,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.394.tgz", - "integrity": "sha512-9NeGvmO2tGztuneXZfYAyW3fDk6Pdl6Ffg8MAUaevA/p0awvA+ti/Vh0ZSTcI81nDTjkzONvrcIcjYAN7x0oSg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.398.tgz", + "integrity": "sha512-iQmMcIosCEPk1Sb3502TR0PMSQ1OV6NVHFbg3jX8nlbea4qgL1SrkANecHZjSpcc77glKUAP9+zY2U3pv545Hw==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.394.tgz", - "integrity": "sha512-toahsYQORrP/TPSBQ7sxj4/fJg3YUrD0ksCj/Z4y2vT6EwrE9iC2BspKgQRa4CBoCqxYDNB2blc+mQ1UuzPOxg==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.398.tgz", + "integrity": "sha512-v0SMz8cIlR0nI7CzkoHjwQhrYKEpB84kH/GxcD10T+L+EVQDQL2HO0TS1tHcB9FA88qD+/HE6bd0NzKXKSRPng==", "cpu": [ "x64" ], @@ -547,9 +547,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.394.tgz", - "integrity": "sha512-R7XBP3l+oeDuBrP0KD80ZBEMsZoxAW8QO2MNsDUV8eVrNJnp6KtGHoA+iCsKYKNOD6wHA/q5qm/jR+gpsz46Aw==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.398.tgz", + "integrity": "sha512-IGcburUp/vyzGtySqP/HgmxznzLsxFL/+AtPShjTNKydwh5Y23nq2y7XQZK39SgHppN8GiVNHCpNrzNykGZNOQ==", "cpu": [ "arm64" ], @@ -564,9 +564,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "0.0.394", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.394.tgz", - "integrity": "sha512-/XYV8srP+pMXbf9Gc3wr58zCzBZvsdA3X4poSvr2uU8yCZ6E4pD0agFaZ1c/CikANJi8nb0Id3kulhEhePz/3A==", + "version": "0.0.398", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.398.tgz", + "integrity": "sha512-PBm2D8lxe8Gipgk0x6i2/kQhpoRzYk6ojFFhhBrZBF7fPK+iWFDQzloahXHQQ4/E7cXP64DqT21oiWC9HHKMrg==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index 55de10f5..c70f8e58 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^0.0.394", + "@github/copilot": "^0.0.398", "@types/node": "^25.0.3", "openai": "^6.15.0", "tsx": "^4.21.0", From cbd2c663f7838db155439361a12c0ffe16fe7124 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:04:28 +0000 Subject: [PATCH 3/8] Add test for custom agent visibility and update investigation Co-authored-by: patniko <26906478+patniko@users.noreply.github.com> --- nodejs/test-custom-agents.js | 49 ++++++++++++++++++++++++++ nodejs/test/e2e/mcp-and-agents.test.ts | 39 ++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 nodejs/test-custom-agents.js diff --git a/nodejs/test-custom-agents.js b/nodejs/test-custom-agents.js new file mode 100644 index 00000000..045876c2 --- /dev/null +++ b/nodejs/test-custom-agents.js @@ -0,0 +1,49 @@ +import { CopilotClient } from "./dist/index.js"; + +const customAgents = [ + { + 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(); + +try { + console.log("Creating session with custom agents..."); + const session = await client.createSession({ + model: "gpt-4o-mini", + customAgents: customAgents, + }); + + console.log(`Session created: ${session.sessionId}`); + + console.log("\nAsking assistant to list custom agents..."); + const message = await session.sendAndWait({ + prompt: "List all custom agents available. Be specific about user-defined or user-provided custom agents that were configured for this session.", + }); + + console.log("\n=== Assistant Response ==="); + console.log(message?.data.content || "No content"); + console.log("==========================\n"); + + // Check if the response mentions our custom agent + const content = (message?.data.content || "").toLowerCase(); + if (content.includes("test-agent") || content.includes("test agent")) { + console.log("✅ SUCCESS: Custom agent 'test-agent' is visible to the assistant!"); + } else if (content.includes("user-defined") || content.includes("user-provided")) { + console.log("⚠️ PARTIAL: Response mentions user-defined/provided agents but doesn't specifically list test-agent"); + } else { + console.log("❌ FAIL: Custom agent 'test-agent' is NOT visible to the assistant"); + } + + await session.destroy(); + await client.stop(); +} catch (error) { + console.error("Error:", error); + await client.stop(); + process.exit(1); +} diff --git a/nodejs/test/e2e/mcp-and-agents.test.ts b/nodejs/test/e2e/mcp-and-agents.test.ts index 49047a0d..f91a19f9 100644 --- a/nodejs/test/e2e/mcp-and-agents.test.ts +++ b/nodejs/test/e2e/mcp-and-agents.test.ts @@ -217,6 +217,45 @@ 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: "test-agent", + displayName: "Test Agent", + description: "A test agent for SDK testing", + 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: "List all custom agents available. Be specific about user-defined custom agents.", + }); + + // 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 mentioned (either by name or in the list) + // The CLI should include custom agents in the task tool description + expect( + content.toLowerCase().includes("test-agent") || + content.toLowerCase().includes("test agent") || + content.toLowerCase().includes("user-defined") || + content.toLowerCase().includes("user-provided") + ).toBe(true); + + await session.destroy(); + }); }); describe("Combined Configuration", () => { From ed8e06f8fd7e3a82b7bbf18cd665389cf6f1aa60 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:04:40 +0000 Subject: [PATCH 4/8] Remove accidental test file Co-authored-by: patniko <26906478+patniko@users.noreply.github.com> --- nodejs/test-custom-agents.js | 49 ------------------------------------ 1 file changed, 49 deletions(-) delete mode 100644 nodejs/test-custom-agents.js diff --git a/nodejs/test-custom-agents.js b/nodejs/test-custom-agents.js deleted file mode 100644 index 045876c2..00000000 --- a/nodejs/test-custom-agents.js +++ /dev/null @@ -1,49 +0,0 @@ -import { CopilotClient } from "./dist/index.js"; - -const customAgents = [ - { - 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(); - -try { - console.log("Creating session with custom agents..."); - const session = await client.createSession({ - model: "gpt-4o-mini", - customAgents: customAgents, - }); - - console.log(`Session created: ${session.sessionId}`); - - console.log("\nAsking assistant to list custom agents..."); - const message = await session.sendAndWait({ - prompt: "List all custom agents available. Be specific about user-defined or user-provided custom agents that were configured for this session.", - }); - - console.log("\n=== Assistant Response ==="); - console.log(message?.data.content || "No content"); - console.log("==========================\n"); - - // Check if the response mentions our custom agent - const content = (message?.data.content || "").toLowerCase(); - if (content.includes("test-agent") || content.includes("test agent")) { - console.log("✅ SUCCESS: Custom agent 'test-agent' is visible to the assistant!"); - } else if (content.includes("user-defined") || content.includes("user-provided")) { - console.log("⚠️ PARTIAL: Response mentions user-defined/provided agents but doesn't specifically list test-agent"); - } else { - console.log("❌ FAIL: Custom agent 'test-agent' is NOT visible to the assistant"); - } - - await session.destroy(); - await client.stop(); -} catch (error) { - console.error("Error:", error); - await client.stop(); - process.exit(1); -} From 9c2bc2afec7c8efb8a8b37a4789c848443cc5ea3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:06:32 +0000 Subject: [PATCH 5/8] Improve test assertion to avoid false positives Co-authored-by: patniko <26906478+patniko@users.noreply.github.com> --- nodejs/test/e2e/mcp-and-agents.test.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/nodejs/test/e2e/mcp-and-agents.test.ts b/nodejs/test/e2e/mcp-and-agents.test.ts index f91a19f9..933bc401 100644 --- a/nodejs/test/e2e/mcp-and-agents.test.ts +++ b/nodejs/test/e2e/mcp-and-agents.test.ts @@ -245,14 +245,19 @@ describe("MCP Servers and Custom Agents", async () => { expect(message?.data.content).toBeDefined(); const content = message!.data.content || ""; - // Check that the custom agent is mentioned (either by name or in the list) - // The CLI should include custom agents in the task tool description - expect( - content.toLowerCase().includes("test-agent") || - content.toLowerCase().includes("test agent") || - content.toLowerCase().includes("user-defined") || - content.toLowerCase().includes("user-provided") - ).toBe(true); + // Check that the custom agent name is mentioned AND + // that it's mentioned in a positive context (available/configured) + // This ensures the agent is actually surfaced, not just mentioned as missing + const lowerContent = content.toLowerCase(); + const hasAgentName = lowerContent.includes("test-agent") || lowerContent.includes("test agent"); + const hasPositiveIndicator = + lowerContent.includes("available") || + lowerContent.includes("configured") || + lowerContent.includes("following") || + lowerContent.includes("include"); + + expect(hasAgentName).toBe(true); + expect(hasPositiveIndicator).toBe(true); await session.destroy(); }); From 3d005934bd1c2bad9efec309b8ae80a7dae70f93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 18:08:16 +0000 Subject: [PATCH 6/8] Make test more robust by checking agent name and description Co-authored-by: patniko <26906478+patniko@users.noreply.github.com> --- nodejs/test/e2e/mcp-and-agents.test.ts | 35 ++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/nodejs/test/e2e/mcp-and-agents.test.ts b/nodejs/test/e2e/mcp-and-agents.test.ts index 933bc401..549aacbe 100644 --- a/nodejs/test/e2e/mcp-and-agents.test.ts +++ b/nodejs/test/e2e/mcp-and-agents.test.ts @@ -221,9 +221,9 @@ describe("MCP Servers and Custom Agents", async () => { it("should surface custom agents to the assistant for listing", async () => { const customAgents: CustomAgentConfig[] = [ { - name: "test-agent", - displayName: "Test Agent", - description: "A test agent for SDK testing", + 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, }, @@ -238,26 +238,29 @@ describe("MCP Servers and Custom Agents", async () => { // 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: "List all custom agents available. Be specific about user-defined custom agents.", + 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 || ""; + const content = message.data.content; - // Check that the custom agent name is mentioned AND - // that it's mentioned in a positive context (available/configured) - // This ensures the agent is actually surfaced, not just mentioned as missing - const lowerContent = content.toLowerCase(); - const hasAgentName = lowerContent.includes("test-agent") || lowerContent.includes("test agent"); - const hasPositiveIndicator = - lowerContent.includes("available") || - lowerContent.includes("configured") || - lowerContent.includes("following") || - lowerContent.includes("include"); + // 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); - expect(hasPositiveIndicator).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(); }); From 4f2a9970d7934f5a0c72d4e97e2bc78cab4d90d5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 21:50:14 +0000 Subject: [PATCH 7/8] Bump @github/copilot to 0.0.399 Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> --- nodejs/package-lock.json | 56 +++++++++++++++++----------------- nodejs/package.json | 2 +- test/harness/package-lock.json | 56 +++++++++++++++++----------------- test/harness/package.json | 2 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/nodejs/package-lock.json b/nodejs/package-lock.json index c1f78b98..77f2ecf0 100644 --- a/nodejs/package-lock.json +++ b/nodejs/package-lock.json @@ -9,7 +9,7 @@ "version": "0.1.8", "license": "MIT", "dependencies": { - "@github/copilot": "^0.0.398", + "@github/copilot": "^0.0.399", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.5" }, @@ -662,26 +662,26 @@ } }, "node_modules/@github/copilot": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.398.tgz", - "integrity": "sha512-Yqma05bNQmgzC2p1JvS0m4kIl+IxqdS/XJ3kvtZxIJiXNpzsuvqxfLfjEF1J7M5JFcQxDjLt4QbVN4kY4KvlMQ==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.399.tgz", + "integrity": "sha512-ULRmqkH6L6mdokjMTfLaJQDidJXDUy0EYE8lHsIDxXD4dUoGjfsNRswZ4We+JxIJiXuTF9U9KqQM55QRj/4kQA==", "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "0.0.398", - "@github/copilot-darwin-x64": "0.0.398", - "@github/copilot-linux-arm64": "0.0.398", - "@github/copilot-linux-x64": "0.0.398", - "@github/copilot-win32-arm64": "0.0.398", - "@github/copilot-win32-x64": "0.0.398" + "@github/copilot-darwin-arm64": "0.0.399", + "@github/copilot-darwin-x64": "0.0.399", + "@github/copilot-linux-arm64": "0.0.399", + "@github/copilot-linux-x64": "0.0.399", + "@github/copilot-win32-arm64": "0.0.399", + "@github/copilot-win32-x64": "0.0.399" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.398.tgz", - "integrity": "sha512-Qj352LtW5Uw+Zk3VR1igvYpizKToIzPD8nVyvM2I4Coxudnrcc+GggstYZwNhvfhj7WbAnDLqfaIJR20TD986A==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.399.tgz", + "integrity": "sha512-8TQWPO9PrjR5g/y13nUmKBpk8oCHPpBPgHgp7hozIGedsbNJrcuABeNEsbkxowTwTiKgXEz5A5DGo5iN2AY+Ww==", "cpu": [ "arm64" ], @@ -695,9 +695,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.398.tgz", - "integrity": "sha512-Eghf9+4xgVMe6q1Tur1AktPS2C2AggmTCFZQeE7ljXzwtj82obOlyX2yslOlPgUgu2XjKJ3zW1r3KCJGjXAvmw==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.399.tgz", + "integrity": "sha512-Ge1a6zGpjTbVOUQyvT18NbphmyPidPoVERq7DOTTo3XdKDm8n2jFh6UjQl7atL0hnUaWsKOTx9qrgTPdQmqMDA==", "cpu": [ "x64" ], @@ -711,9 +711,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.398.tgz", - "integrity": "sha512-iQmMcIosCEPk1Sb3502TR0PMSQ1OV6NVHFbg3jX8nlbea4qgL1SrkANecHZjSpcc77glKUAP9+zY2U3pv545Hw==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.399.tgz", + "integrity": "sha512-41TCc1zxSd6qI56xzOyVR91mW8i7SXQ6IrRbsDBAF8i1dbyzIDO2YZ4c23fn8IRJ3C0aCQvfMoFf/BpzHQ6igw==", "cpu": [ "arm64" ], @@ -727,9 +727,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.398.tgz", - "integrity": "sha512-v0SMz8cIlR0nI7CzkoHjwQhrYKEpB84kH/GxcD10T+L+EVQDQL2HO0TS1tHcB9FA88qD+/HE6bd0NzKXKSRPng==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.399.tgz", + "integrity": "sha512-TNjJ/Kli74wdFycayvFW8mSmBc6ssURGxc+kiJkL+DYKloefBvViqz4I9Luwee7jrCdP1sgHwcelMrGbQ9fDHQ==", "cpu": [ "x64" ], @@ -743,9 +743,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.398.tgz", - "integrity": "sha512-IGcburUp/vyzGtySqP/HgmxznzLsxFL/+AtPShjTNKydwh5Y23nq2y7XQZK39SgHppN8GiVNHCpNrzNykGZNOQ==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.399.tgz", + "integrity": "sha512-VInXjz1gaQcP0PZ18FBT0wdCNJld1huhisxUcegRpYdGgKHfUxdwU1N/2LcoZZZ+iin1NPt3mNsBJiI5W24RCA==", "cpu": [ "arm64" ], @@ -759,9 +759,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.398.tgz", - "integrity": "sha512-PBm2D8lxe8Gipgk0x6i2/kQhpoRzYk6ojFFhhBrZBF7fPK+iWFDQzloahXHQQ4/E7cXP64DqT21oiWC9HHKMrg==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.399.tgz", + "integrity": "sha512-ddIYUm+HPvwhTOcVFIZNoIH8a00Wp6PtE/Zq7slShSMMjzqWLuvY0s9NdNt6ijPqxtNgwuHWPfPVS4OvqfkwSA==", "cpu": [ "x64" ], diff --git a/nodejs/package.json b/nodejs/package.json index fb8eb881..9ef9478d 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -40,7 +40,7 @@ "author": "GitHub", "license": "MIT", "dependencies": { - "@github/copilot": "^0.0.398", + "@github/copilot": "^0.0.399", "vscode-jsonrpc": "^8.2.1", "zod": "^4.3.5" }, diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json index 11cdb42b..1e05947a 100644 --- a/test/harness/package-lock.json +++ b/test/harness/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@github/copilot": "^0.0.398", + "@github/copilot": "^0.0.399", "@types/node": "^25.0.3", "openai": "^6.15.0", "tsx": "^4.21.0", @@ -461,27 +461,27 @@ } }, "node_modules/@github/copilot": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.398.tgz", - "integrity": "sha512-Yqma05bNQmgzC2p1JvS0m4kIl+IxqdS/XJ3kvtZxIJiXNpzsuvqxfLfjEF1J7M5JFcQxDjLt4QbVN4kY4KvlMQ==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-0.0.399.tgz", + "integrity": "sha512-ULRmqkH6L6mdokjMTfLaJQDidJXDUy0EYE8lHsIDxXD4dUoGjfsNRswZ4We+JxIJiXuTF9U9KqQM55QRj/4kQA==", "dev": true, "license": "SEE LICENSE IN LICENSE.md", "bin": { "copilot": "npm-loader.js" }, "optionalDependencies": { - "@github/copilot-darwin-arm64": "0.0.398", - "@github/copilot-darwin-x64": "0.0.398", - "@github/copilot-linux-arm64": "0.0.398", - "@github/copilot-linux-x64": "0.0.398", - "@github/copilot-win32-arm64": "0.0.398", - "@github/copilot-win32-x64": "0.0.398" + "@github/copilot-darwin-arm64": "0.0.399", + "@github/copilot-darwin-x64": "0.0.399", + "@github/copilot-linux-arm64": "0.0.399", + "@github/copilot-linux-x64": "0.0.399", + "@github/copilot-win32-arm64": "0.0.399", + "@github/copilot-win32-x64": "0.0.399" } }, "node_modules/@github/copilot-darwin-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.398.tgz", - "integrity": "sha512-Qj352LtW5Uw+Zk3VR1igvYpizKToIzPD8nVyvM2I4Coxudnrcc+GggstYZwNhvfhj7WbAnDLqfaIJR20TD986A==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-0.0.399.tgz", + "integrity": "sha512-8TQWPO9PrjR5g/y13nUmKBpk8oCHPpBPgHgp7hozIGedsbNJrcuABeNEsbkxowTwTiKgXEz5A5DGo5iN2AY+Ww==", "cpu": [ "arm64" ], @@ -496,9 +496,9 @@ } }, "node_modules/@github/copilot-darwin-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.398.tgz", - "integrity": "sha512-Eghf9+4xgVMe6q1Tur1AktPS2C2AggmTCFZQeE7ljXzwtj82obOlyX2yslOlPgUgu2XjKJ3zW1r3KCJGjXAvmw==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-0.0.399.tgz", + "integrity": "sha512-Ge1a6zGpjTbVOUQyvT18NbphmyPidPoVERq7DOTTo3XdKDm8n2jFh6UjQl7atL0hnUaWsKOTx9qrgTPdQmqMDA==", "cpu": [ "x64" ], @@ -513,9 +513,9 @@ } }, "node_modules/@github/copilot-linux-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.398.tgz", - "integrity": "sha512-iQmMcIosCEPk1Sb3502TR0PMSQ1OV6NVHFbg3jX8nlbea4qgL1SrkANecHZjSpcc77glKUAP9+zY2U3pv545Hw==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-0.0.399.tgz", + "integrity": "sha512-41TCc1zxSd6qI56xzOyVR91mW8i7SXQ6IrRbsDBAF8i1dbyzIDO2YZ4c23fn8IRJ3C0aCQvfMoFf/BpzHQ6igw==", "cpu": [ "arm64" ], @@ -530,9 +530,9 @@ } }, "node_modules/@github/copilot-linux-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.398.tgz", - "integrity": "sha512-v0SMz8cIlR0nI7CzkoHjwQhrYKEpB84kH/GxcD10T+L+EVQDQL2HO0TS1tHcB9FA88qD+/HE6bd0NzKXKSRPng==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-0.0.399.tgz", + "integrity": "sha512-TNjJ/Kli74wdFycayvFW8mSmBc6ssURGxc+kiJkL+DYKloefBvViqz4I9Luwee7jrCdP1sgHwcelMrGbQ9fDHQ==", "cpu": [ "x64" ], @@ -547,9 +547,9 @@ } }, "node_modules/@github/copilot-win32-arm64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.398.tgz", - "integrity": "sha512-IGcburUp/vyzGtySqP/HgmxznzLsxFL/+AtPShjTNKydwh5Y23nq2y7XQZK39SgHppN8GiVNHCpNrzNykGZNOQ==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-0.0.399.tgz", + "integrity": "sha512-VInXjz1gaQcP0PZ18FBT0wdCNJld1huhisxUcegRpYdGgKHfUxdwU1N/2LcoZZZ+iin1NPt3mNsBJiI5W24RCA==", "cpu": [ "arm64" ], @@ -564,9 +564,9 @@ } }, "node_modules/@github/copilot-win32-x64": { - "version": "0.0.398", - "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.398.tgz", - "integrity": "sha512-PBm2D8lxe8Gipgk0x6i2/kQhpoRzYk6ojFFhhBrZBF7fPK+iWFDQzloahXHQQ4/E7cXP64DqT21oiWC9HHKMrg==", + "version": "0.0.399", + "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-0.0.399.tgz", + "integrity": "sha512-ddIYUm+HPvwhTOcVFIZNoIH8a00Wp6PtE/Zq7slShSMMjzqWLuvY0s9NdNt6ijPqxtNgwuHWPfPVS4OvqfkwSA==", "cpu": [ "x64" ], diff --git a/test/harness/package.json b/test/harness/package.json index c70f8e58..e859b49b 100644 --- a/test/harness/package.json +++ b/test/harness/package.json @@ -11,7 +11,7 @@ "test": "vitest run" }, "devDependencies": { - "@github/copilot": "^0.0.398", + "@github/copilot": "^0.0.399", "@types/node": "^25.0.3", "openai": "^6.15.0", "tsx": "^4.21.0", From a5dc3a97d8b8c59314e2a8c1bbc5e361f2599150 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:24:53 +0000 Subject: [PATCH 8/8] Run prettier to format test file Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com> --- nodejs/test/e2e/mcp-and-agents.test.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/nodejs/test/e2e/mcp-and-agents.test.ts b/nodejs/test/e2e/mcp-and-agents.test.ts index 549aacbe..9553e40e 100644 --- a/nodejs/test/e2e/mcp-and-agents.test.ts +++ b/nodejs/test/e2e/mcp-and-agents.test.ts @@ -244,22 +244,28 @@ describe("MCP Servers and Custom Agents", async () => { // 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"); - + 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."); + console.warn( + "Custom agent name found but description not included in response. This may indicate partial surfacing." + ); } await session.destroy();