From 9f2c02d9f7db096f7a9b4a193300310e3000f241 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 23 Oct 2024 03:43:57 -0700 Subject: [PATCH] Chat with the default agent by default from web app home Had temporarily updated the default selected agent to last used. Revert for now as 1. The previous logic was buggy. It didn't select the default agent even when the last used agent was the default agent. Which would require more work. 2. It maybe too early anyway to set the default agent to last used. --- src/interface/web/app/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interface/web/app/page.tsx b/src/interface/web/app/page.tsx index 5c593401..b570e86c 100644 --- a/src/interface/web/app/page.tsx +++ b/src/interface/web/app/page.tsx @@ -132,8 +132,8 @@ function ChatBodyData(props: ChatBodyDataProps) { useEffect(() => { const agents = (agentsData || []).filter((agent) => agent !== null && agent !== undefined); setAgents(agents); - // set the selected agent to the most recently used agent, first agent is always khoj - setSelectedAgent(agents.length > 1 ? agents[1].slug : "khoj"); + // set the first agent, which is always the default agent, as the default for chat + setSelectedAgent(agents.length > 1 ? agents[0].slug : "khoj"); // generate colored icons for the available agents const agentIcons = agents.map((agent) => getIconFromIconName(agent.icon, agent.color)!);