Skip to content

Commit

Permalink
Merge pull request TransformerOptimus#754 from TransformerOptimus/max…
Browse files Browse the repository at this point in the history
…-iteration-fix

Max iteration fix
  • Loading branch information
I’m authored Jul 13, 2023
2 parents fc19d9a + 45fac46 commit 328d382
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,7 @@ def execute_next_action(self, agent_execution_id):
agent_workflow_step = session.query(AgentWorkflowStep).filter(
AgentWorkflowStep.id == agent_execution.current_step_id).first()

try:
response = spawned_agent.execute(agent_workflow_step)
except RuntimeError as e:
# If our execution encounters an error we return and attempt to retry
logger.error("Error executing the agent:", e)
superagi.worker.execute_agent.apply_async((agent_execution_id, datetime.now()), countdown=15)
session.close()
return

response = spawned_agent.execute(agent_workflow_step)

if "retry" in response and response["retry"]:
response = spawned_agent.execute(agent_workflow_step)
Expand Down

0 comments on commit 328d382

Please sign in to comment.