From 809956d1aaf48032afc8a913c9ae86fc87669cf4 Mon Sep 17 00:00:00 2001 From: Charles Packer Date: Mon, 22 Sep 2025 17:51:32 -0700 Subject: [PATCH] fix(core): patch bug in the broadcast multi-agent tool where we were not properly awating returns [LET-4484] (#4866) fix(core): patch bug in the broadcast multi-agent tool where we were not await-ing the responses to return them properly --- .../tool_executor/multi_agent_tool_executor.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/letta/services/tool_executor/multi_agent_tool_executor.py b/letta/services/tool_executor/multi_agent_tool_executor.py index 8a5f7fea..76747c66 100644 --- a/letta/services/tool_executor/multi_agent_tool_executor.py +++ b/letta/services/tool_executor/multi_agent_tool_executor.py @@ -76,13 +76,10 @@ class LettaMultiAgentToolExecutor(ToolExecutor): f"{message}" ) - tasks = [ - safe_create_task( - self._process_agent(agent_state=agent_state, message=augmented_message), label=f"process_agent_{agent_state.id}" - ) - for agent_state in matching_agents - ] - results = await asyncio.gather(*tasks) + # Run concurrent requests and collect their return values. + # Note: Do not wrap with safe_create_task here — it swallows return values (returns None). + coros = [self._process_agent(agent_state=a_state, message=augmented_message) for a_state in matching_agents] + results = await asyncio.gather(*coros) return str(results) async def _process_agent(self, agent_state: AgentState, message: str) -> Dict[str, Any]: