mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-04 02:48:44 +02:00
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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user