From 6caa6f4008c0672f8ef06811b15303e16b8158fd Mon Sep 17 00:00:00 2001 From: Debanjum Date: Wed, 30 Jul 2025 17:29:14 -0700 Subject: [PATCH] Make async call to get agent files from async agent/conversation API This should avoid the sync_to_async errors thrown by django when calling the /api/agent/conversation API endpoint --- 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 be6b25d2..3ac48d53 100644 --- a/src/khoj/routers/api_agents.py +++ b/src/khoj/routers/api_agents.py @@ -138,7 +138,7 @@ async def get_agent_by_conversation( else: agent_chat_model = None - has_files = agent.fileobject_set.exists() + has_files = await agent.fileobject_set.aexists() agents_packet = { "slug": agent.slug,