Skip to content

Commit c06c3f5

Browse files
yuhongsun96brijsiyag-meesho
authored andcommitted
Fix Toggles (onyx-dot-app#5469)
1 parent fe976f7 commit c06c3f5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

web/src/app/chat/components/input/ActionManagement.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@ function MCPToolsList({
268268
? disabledToolIds.filter((id) => id !== toolId)
269269
: [...disabledToolIds, toolId],
270270
});
271+
272+
// If we're disabling a tool that is currently forced, remove it from forced tools
273+
if (!disabled && forcedToolIds.includes(toolId)) {
274+
setForcedToolIds(forcedToolIds.filter((id) => id !== toolId));
275+
}
271276
};
272277

273278
const toggleForcedTool = (toolId: number) => {
@@ -427,6 +432,11 @@ export function ActionToggle({ selectedAssistant }: ActionToggleProps) {
427432
? disabledToolIds.filter((id) => id !== toolId)
428433
: [...disabledToolIds, toolId],
429434
});
435+
436+
// If we're disabling a tool that is currently forced, remove it from forced tools
437+
if (!disabled && forcedToolIds.includes(toolId)) {
438+
setForcedToolIds(forcedToolIds.filter((id) => id !== toolId));
439+
}
430440
};
431441

432442
const toggleForcedTool = (toolId: number) => {

0 commit comments

Comments
 (0)