mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
fix: enable/disable all operates on full tool set, not just filtered subset
This commit is contained in:
parent
50f510d8f6
commit
691ecc685b
1 changed files with 7 additions and 4 deletions
|
|
@ -296,24 +296,27 @@ const MCPToolConfiguration: React.FC<MCPToolConfigurationProps> = ({
|
|||
};
|
||||
|
||||
const handleEnableSuggested = () => {
|
||||
const suggestedNames = pinnedFiltered.map((t) => t.name);
|
||||
// Enable ALL suggested tools (not just the currently filtered subset)
|
||||
const suggestedNames = suggestedTools.map((t) => t.name);
|
||||
const others = allowedTools.filter((n) => !suggestedToolNames.has(n));
|
||||
onAllowedToolsChange([...others, ...suggestedNames]);
|
||||
};
|
||||
|
||||
const handleDisableSuggested = () => {
|
||||
// Disable ALL suggested tools (not just the currently filtered subset)
|
||||
onAllowedToolsChange(allowedTools.filter((n) => !suggestedToolNames.has(n)));
|
||||
};
|
||||
|
||||
const handleEnableRest = () => {
|
||||
const restNames = restFiltered.map((t) => t.name);
|
||||
// Enable ALL non-suggested tools (not just the currently filtered subset)
|
||||
const restNames = tools.filter((t) => !suggestedToolNames.has(t.name)).map((t) => t.name);
|
||||
const current = new Set(allowedTools);
|
||||
onAllowedToolsChange([...allowedTools, ...restNames.filter((n) => !current.has(n))]);
|
||||
};
|
||||
|
||||
const handleDisableRest = () => {
|
||||
const restNameSet = new Set(restFiltered.map((t) => t.name));
|
||||
onAllowedToolsChange(allowedTools.filter((n) => !restNameSet.has(n)));
|
||||
// Disable ALL non-suggested tools (not just the currently filtered subset)
|
||||
onAllowedToolsChange(allowedTools.filter((n) => suggestedToolNames.has(n)));
|
||||
};
|
||||
|
||||
// Don't show anything if required fields aren't filled
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue