mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 23:41:49 +00:00
Reset error_retries on successful loop iteration
Reset the error_retries counter immediately after a successful message-loop iteration inside the Agent class, and remove the redundant reset outside the loop. This consolidates the retry counter logic so it is cleared only when an iteration completes successfully.
This commit is contained in:
parent
7ab276098c
commit
01cdb7b92d
1 changed files with 2 additions and 2 deletions
4
agent.py
4
agent.py
|
|
@ -491,6 +491,8 @@ class Agent:
|
|||
if tools_result: # final response of message loop available
|
||||
return tools_result # break the execution if the task is done
|
||||
|
||||
error_retries = 0 # reset retry counter on successful iteration
|
||||
|
||||
# exceptions inside message loop:
|
||||
except InterventionException as e:
|
||||
error_retries = 0 # reset retry counter on user intervention
|
||||
|
|
@ -515,8 +517,6 @@ class Agent:
|
|||
"message_loop_end", loop_data=self.loop_data
|
||||
)
|
||||
|
||||
error_retries = 0 # reset retry counter on successful iteration
|
||||
|
||||
# exceptions outside message loop:
|
||||
except InterventionException as e:
|
||||
error_retries = 0 # reset retry counter on user intervention
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue