fix: show MCP tools in all provider groups when shared

When multiple MCP servers expose the same tool names (e.g., several
kusto-mcp instances), each server's group now shows its tools instead
of only the first server getting the tools and others showing 0/0.

Deduplicate the effectiveAutoApprovedCount to avoid double-counting
shared tools in the pill header.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-28 19:35:56 +01:00
co-authored by Copilot
parent 6505493735
commit f0114058ba
3 changed files with 26 additions and 6 deletions
+4 -2
View File
@@ -443,7 +443,7 @@ describe('groupApprovalToolsByProvider', () => {
expect(builtinGroups[0].tools.length).toBe(5);
});
test('multi-provider tools go into first provider group, second provider gets empty group', () => {
test('multi-provider tools appear in all provider groups', () => {
const tooling = makeTooling([
makeMcpServer('git-a', 'Git A', ['git.status']),
makeMcpServer('git-b', 'Git B', ['git.status']),
@@ -455,10 +455,12 @@ describe('groupApprovalToolsByProvider', () => {
expect(mcpGroups.length).toBe(2);
const gitA = mcpGroups.find((g) => g.label === 'Git A');
expect(gitA).toBeDefined();
expect(gitA!.tools.length).toBe(1);
expect(gitA!.tools[0].providerNames).toEqual(['Git A', 'Git B']);
const gitB = mcpGroups.find((g) => g.label === 'Git B');
expect(gitB).toBeDefined();
expect(gitB!.tools.length).toBe(0);
expect(gitB!.tools.length).toBe(1);
expect(gitB!.tools[0].id).toBe('git.status');
});
test('sorts builtin first, then MCP by name, then LSP by name', () => {