From 822d81fc5e303d14c032777968dbbfc97ee56c8d Mon Sep 17 00:00:00 2001 From: Aksh Parekh Date: Sat, 15 Nov 2025 00:03:37 -0800 Subject: [PATCH] [BUG-FIX] Reflexion Agent task attribute error --- swarms/agents/reasoning_agents.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/swarms/agents/reasoning_agents.py b/swarms/agents/reasoning_agents.py index be2e34fc..ea4e4b33 100644 --- a/swarms/agents/reasoning_agents.py +++ b/swarms/agents/reasoning_agents.py @@ -284,8 +284,12 @@ class ReasoningAgentRouter: The result of the reasoning process (format depends on agent and output_type). """ try: - swarm = self.select_swarm() - return swarm.run(task=task, *args, **kwargs) + if self.swarm_type == "ReflexionAgent": + swarm = self.select_swarm() + return swarm.run(tasks=[task], *args, **kwargs) + else: + swarm = self.select_swarm() + return swarm.run(task=task, *args, **kwargs) except Exception as e: raise ReasoningAgentExecutorError( f"ReasoningAgentRouter Error: {e} Traceback: {traceback.format_exc()} If the error persists, please check the agent's configuration and try again. If you would like support book a call with our team at https://cal.com/swarms"