From 5110a060852ecf7e656d6d512cf05f313d8b118c Mon Sep 17 00:00:00 2001 From: Debanjum Date: Tue, 10 Jun 2025 15:29:46 -0700 Subject: [PATCH] Fix GET agents API to return agent specific chat model There had been a regression that made all agents display the default chat model instead of the actual chat model associated with the agent. This change resolves that issue by prioritizing agent specific chat model from DB (over user or server chat model). --- src/khoj/routers/api_agents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/khoj/routers/api_agents.py b/src/khoj/routers/api_agents.py index 117663a7..bc9a0adc 100644 --- a/src/khoj/routers/api_agents.py +++ b/src/khoj/routers/api_agents.py @@ -62,7 +62,7 @@ async def all_agents( for agent in agents: files = agent.fileobject_set.all() file_names = [file.file_name for file in files] - agent_chat_model = await AgentAdapters.aget_agent_chat_model(default_agent, user) + agent_chat_model = await AgentAdapters.aget_agent_chat_model(agent, user) agent_packet = { "slug": agent.slug, "name": agent.name,