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
fix(agent): guard _inject_budget_warning against ZeroDivisionError
itxaiohanglovercce612838a73
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex fe325c74a..bfd8d494c 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1537,7 +1537,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):This gives the LLM advance notice to wrap up, save partial results, and call donerather than exhausting all steps with nothing saved."""- if step_info is None:+ if step_info is None or step_info.max_steps <= 0:returnsteps_used = step_info.step_number + 1 # Convert 0-indexed to 1-indexed