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
This commit is contained in:
committed by
Caren Thomas
parent
8395ec429a
commit
809956d1aa
@@ -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]:
|
||||
|
||||
Reference in New Issue
Block a user