From 6a30da3e9e9ffb232530584e51bc064cd840f8f0 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Fri, 11 Apr 2025 11:12:22 -0700 Subject: [PATCH] Fix default state for tools in the agent settings for the chat sidebar --- src/interface/web/app/components/chatSidebar/chatSidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/web/app/components/chatSidebar/chatSidebar.tsx b/src/interface/web/app/components/chatSidebar/chatSidebar.tsx index 1003204e..1e7c0325 100644 --- a/src/interface/web/app/components/chatSidebar/chatSidebar.tsx +++ b/src/interface/web/app/components/chatSidebar/chatSidebar.tsx @@ -328,12 +328,12 @@ function ChatSidebarInternal({ ...props }: ChatSideBarProps) { if (agentData) { setInputTools(agentData.input_tools); setDisplayInputTools(agentData.input_tools); - if (agentData.input_tools === undefined) { + if (agentData.input_tools === undefined || agentData.input_tools.length === 0) { setDisplayInputTools(agentConfigurationOptions?.input_tools ? Object.keys(agentConfigurationOptions.input_tools) : []); } setOutputModes(agentData.output_modes); setDisplayOutputModes(agentData.output_modes); - if (agentData.output_modes === undefined) { + if (agentData.output_modes === undefined || agentData.output_modes.length === 0) { setDisplayOutputModes(agentConfigurationOptions?.output_modes ? Object.keys(agentConfigurationOptions.output_modes) : []); }