diff --git a/app/agent/browser.py b/app/agent/browser.py index ae0ce2f..ec1b573 100644 --- a/app/agent/browser.py +++ b/app/agent/browser.py @@ -111,14 +111,14 @@ class BrowserAgent(ToolCallAgent): ) self.memory.add_message(image_message) - # Replace placeholders with actual browser state info - self.next_step_prompt = NEXT_STEP_PROMPT.format( - url_placeholder=url_info, - tabs_placeholder=tabs_info, - content_above_placeholder=content_above_info, - content_below_placeholder=content_below_info, - results_placeholder=results_info, - ) + # Replace placeholders with actual browser state info + self.next_step_prompt = NEXT_STEP_PROMPT.format( + url_placeholder=url_info, + tabs_placeholder=tabs_info, + content_above_placeholder=content_above_info, + content_below_placeholder=content_below_info, + results_placeholder=results_info, + ) # Call parent implementation result = await super().think() diff --git a/app/agent/toolcall.py b/app/agent/toolcall.py index 76f6f01..66b74c0 100644 --- a/app/agent/toolcall.py +++ b/app/agent/toolcall.py @@ -115,6 +115,7 @@ class ToolCallAgent(ReActAgent): # For 'auto' mode, continue with content if no commands but content exists if self.tool_choices == ToolChoice.AUTO and not self.tool_calls: + self.state = AgentState.FINISHED return bool(content) return bool(self.tool_calls)