From e1839133722da351282a287e17c973eb41ff72ec Mon Sep 17 00:00:00 2001 From: xufeng8 Date: Tue, 11 Mar 2025 13:50:10 +0800 Subject: [PATCH] =?UTF-8?q?the=20'state'=20and=20=C2=A0'current=5Fstep'=20?= =?UTF-8?q?should=20be=20reset=20after=20every=20loop=20,=20cefengxu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/agent/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/agent/base.py b/app/agent/base.py index 43132cf..9ca8731 100644 --- a/app/agent/base.py +++ b/app/agent/base.py @@ -144,8 +144,8 @@ class BaseAgent(BaseModel, ABC): results.append(f"Step {self.current_step}: {step_result}") if self.current_step >= self.max_steps: - self.current_step = 0 # setting back to 0 when reached max steps - self.state = AgentState.IDLE # setting the status + self.current_step = 0 # setting back to 0 when reached max steps, cefengxu + self.state = AgentState.IDLE # setting the status , cefengxu results.append(f"Terminated: Reached max steps ({self.max_steps})") return "\n".join(results) if results else "No steps executed"