From 40011926a0594b96fcf3d9b3ee187b08e91809a7 Mon Sep 17 00:00:00 2001 From: Robert Brennan Date: Thu, 14 Nov 2024 12:00:28 -0500 Subject: [PATCH] fix while true --- openhands/controller/agent_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openhands/controller/agent_controller.py b/openhands/controller/agent_controller.py index f6ea737d52d5..b038cecfd8fa 100644 --- a/openhands/controller/agent_controller.py +++ b/openhands/controller/agent_controller.py @@ -42,6 +42,7 @@ ) from openhands.events.serialization.event import truncate_content from openhands.llm.llm import LLM +from openhands.utils.shutdown_listener import should_continue # note: RESUME is only available on web GUI TRAFFIC_CONTROL_REMINDER = ( @@ -192,7 +193,7 @@ async def start_step_loop(self): """The main loop for the agent's step-by-step execution.""" self.log('info', 'Starting step loop...') - while True: + while should_continue(): if self._closed: break try: