diff --git a/src/interface/web/app/components/chatSidebar/chatSidebar.tsx b/src/interface/web/app/components/chatSidebar/chatSidebar.tsx index 1d0b4c0d..0dc18bcd 100644 --- a/src/interface/web/app/components/chatSidebar/chatSidebar.tsx +++ b/src/interface/web/app/components/chatSidebar/chatSidebar.tsx @@ -317,7 +317,7 @@ function ChatSidebarInternal({ ...props }: ChatSideBarProps) { const [inputTools, setInputTools] = useState(); const [outputModes, setOutputModes] = useState(); const [hasModified, setHasModified] = useState(false); - const [isDefaultAgent, setIsDefaultAgent] = useState(!agentData || agentData?.slug.toLowerCase() === "khoj"); + const [isDefaultAgent, setIsDefaultAgent] = useState(!agentData || agentData?.slug?.toLowerCase() === "khoj"); const [displayInputTools, setDisplayInputTools] = useState(); const [displayOutputModes, setDisplayOutputModes] = useState(); @@ -338,11 +338,11 @@ function ChatSidebarInternal({ ...props }: ChatSideBarProps) { setDisplayOutputModes(agentConfigurationOptions?.output_modes ? Object.keys(agentConfigurationOptions.output_modes) : []); } - if (agentData.name.toLowerCase() === "khoj" || agentData.is_hidden === true) { + if (agentData.name?.toLowerCase() === "khoj" || agentData.is_hidden === true) { setIsEditable(true); } - if (agentData.slug.toLowerCase() === "khoj") { + if (agentData.slug?.toLowerCase() === "khoj") { setSelectedModel(undefined); setCustomPrompt(undefined); setIsDefaultAgent(true);