fix: regenerate pi-claude-cli MCP config per session and auto-sync skill tools
The MCP config was generated lazily once and locked, so engine session-scoped tools (fn_review_spec, fn_review_step) never reached the Claude CLI subprocess and triage/executor sessions failed with "unknown tool" errors. Now the config is hashed per call and rewritten when the tool set changes. Also adds scripts/sync-fusion-skill-tools.mjs to regenerate the SKILL.md tool-categories block from extension.ts at build time, with a --check mode wired into skill-sync tests so drift fails CI. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -269,4 +269,26 @@ describe("writeMcpConfig", () => {
|
||||
expect(result).toMatch(/pi-claude-mcp-config/);
|
||||
expect(result).toMatch(/\.json$/);
|
||||
});
|
||||
|
||||
it("includes cacheKey in filenames when provided so distinct tool sets do not collide", () => {
|
||||
const toolDefs: McpToolDef[] = [
|
||||
{
|
||||
name: "search",
|
||||
description: "Search",
|
||||
inputSchema: { type: "object" },
|
||||
},
|
||||
];
|
||||
|
||||
const pathA = writeMcpConfig(toolDefs, "aaaaaaaaaaaa");
|
||||
const pathB = writeMcpConfig(toolDefs, "bbbbbbbbbbbb");
|
||||
|
||||
expect(pathA).toContain("aaaaaaaaaaaa");
|
||||
expect(pathB).toContain("bbbbbbbbbbbb");
|
||||
expect(pathA).not.toBe(pathB);
|
||||
|
||||
const schemaPathA = mocks.writeFileSync.mock.calls[0][0];
|
||||
const schemaPathB = mocks.writeFileSync.mock.calls[2][0];
|
||||
expect(schemaPathA).toContain("aaaaaaaaaaaa");
|
||||
expect(schemaPathB).toContain("bbbbbbbbbbbb");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user