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
+6 -4
View File
@@ -131,15 +131,17 @@ export function ChatPane({
);
const effectiveAutoApprovedCount = useMemo(() => {
const groups = groupApprovalToolsByProvider(approvalTools, toolingSettings);
let count = 0;
const counted = new Set<string>();
for (const group of groups) {
if (group.serverApprovalKey && effectiveAutoApproved.has(group.serverApprovalKey)) {
count += group.tools.length;
for (const tool of group.tools) counted.add(tool.id);
} else {
count += group.tools.filter((t) => effectiveAutoApproved.has(t.id)).length;
for (const tool of group.tools) {
if (effectiveAutoApproved.has(tool.id)) counted.add(tool.id);
}
}
}
return count;
return counted.size;
}, [approvalTools, effectiveAutoApproved, toolingSettings]);
useEffect(() => {