Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Success to true msg
Magnus Müllerb59c2bf53900
diff --git a/.gitignore b/.gitignoreindex 837aae7b1..367aea15c 100644--- a/.gitignore+++ b/.gitignore@@ -70,3 +70,5 @@ TOOL_CHANGES_SUMMARY.mdclaude-code-todo+result_judge.md+result.md\ No newline at end of filediff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 52d24d5a4..f958d2f47 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -883,7 +883,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):if step_info and step_info.is_last_step():# Add last step warning if neededmsg = 'You reached max_steps - this is your last step. Your only tool available is the "done" tool. No other tool is available. All other tools which you see in history or examples are not available.'- msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false! E.g. if not all steps are fully completed.'+ msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false! E.g. if not all steps are fully completed. Else success to true.'msg += '\nInclude everything you found out for the ultimate task in the done text.'self.logger.debug('Last step finishing up')self._message_manager._add_context_message(UserMessage(content=msg))@@ -894,8 +894,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):# Create recovery messageif self.state.consecutive_failures >= self.settings.max_failures and self.settings.final_response_after_failure:msg = f'You failed {self.settings.max_failures} times. Therefore we terminate the agent.'- msg += 'Your only tool available is the "done" tool. No other tool is available. All other tools which you see in history or examples are not available.'- msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false! E.g. if not all steps are fully completed.'+ msg += '\nYour only tool available is the "done" tool. No other tool is available. All other tools which you see in history or examples are not available.'+ msg += '\nIf the task is not yet fully finished as requested by the user, set success in "done" to false! E.g. if not all steps are fully completed. Else success to true.'msg += '\nInclude everything you found out for the ultimate task in the done text.'self.logger.debug('Force done action, because we reached max_failures.')