Skip to content

Commit

Permalink
adding countdown in case of agent stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
TransformerOptimus committed Jul 13, 2023
1 parent 9a6c115 commit 1bee07d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion superagi/jobs/agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ def execute_next_action(self, agent_execution_id):
response = spawned_agent.execute(agent_workflow_step)

if "retry" in response and response["retry"]:
response = spawned_agent.execute(agent_workflow_step)
superagi.worker.execute_agent.apply_async((agent_execution_id, datetime.now()), countdown=10)
session.close()
return

agent_execution.current_step_id = agent_workflow_step.next_step_id
session.commit()
if response["result"] == "COMPLETE":
Expand Down

0 comments on commit 1bee07d

Please sign in to comment.