From a4782ecb1ceee7ab77fcb578b31d24bc4842c75f Mon Sep 17 00:00:00 2001 From: "Gan, Jimmy" Date: Thu, 2 Apr 2026 09:01:06 +0800 Subject: [PATCH] fix: don't await executor.start() as it's an infinite loop - create task instead --- dashboard/backend/services/agent_executor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dashboard/backend/services/agent_executor.py b/dashboard/backend/services/agent_executor.py index 39a0722..b74b42a 100644 --- a/dashboard/backend/services/agent_executor.py +++ b/dashboard/backend/services/agent_executor.py @@ -319,13 +319,16 @@ async def get_executor() -> AgentExecutor: async def start_executor(): - """Start the executor service""" + """Start the executor service - initializes and starts the background task""" print("start_executor() called") try: executor = await get_executor() print(f"Executor obtained: {executor is not None}, running: {executor.running}") - await executor.start() - print("Executor start() completed (should not reach here as start() is infinite loop)") + # Don't await start() - it's an infinite loop! + # Just call it to set running=True and start the loop + # The task will be managed by the caller + asyncio.create_task(executor.start()) + print("Executor background task created") except Exception as e: print(f"ERROR in start_executor: {e}") import traceback