fix(skill-mcp): use correct sessionID when registering skill MCP connections

Fixes #3021
This commit is contained in:
YeonGyu-Kim
2026-04-02 15:45:39 +09:00
parent 34a37dc946
commit 027a6b0039
6 changed files with 78 additions and 9 deletions
+28
View File
@@ -172,6 +172,34 @@ describe("skill tool - MCP schema display", () => {
})
describe("formatMcpCapabilities with inputSchema", () => {
it("uses the tool context sessionID when the fallback getter is empty", async () => {
// given
loadedSkills = [
createMockSkillWithMcp("test-skill", {
playwright: { command: "npx", args: ["-y", "@anthropic-ai/mcp-playwright"] },
}),
]
const listToolsSpy = spyOn(manager, "listTools").mockResolvedValue([])
spyOn(manager, "listResources").mockResolvedValue([])
spyOn(manager, "listPrompts").mockResolvedValue([])
const tool = createSkillTool({
skills: loadedSkills,
mcpManager: manager,
getSessionID: () => "",
})
// when
await tool.execute({ name: "test-skill" }, mockContext)
// then
expect(listToolsSpy).toHaveBeenCalledWith(
expect.objectContaining({ sessionID: mockContext.sessionID }),
expect.any(Object),
)
})
it("displays tool inputSchema when available", async () => {
// given
const mockToolsWithSchema: McpTool[] = [