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
Refactor Agent class to rename 'state' variable to 'browser_state_summary' for improved clarity in step execution logic.
Magnus Müllerb3abed3bd320
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 55517bdaf..34aadbaae 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -455,7 +455,7 @@ class Agent(Generic[Context]):async def step(self, step_info: AgentStepInfo | None = None) -> None:"""Execute one step of the task"""logger.info(f'📍 Step {self.state.n_steps}')- state = None+ browser_state_summary = Nonemodel_output = Noneresult: list[ActionResult] = []step_start_time = time.time()@@ -615,7 +615,7 @@ class Agent(Generic[Context]):if not result:return- if state:+ if browser_state_summary:metadata = StepMetadata(step_number=self.state.n_steps,step_start_time=step_start_time,