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 two bugs in BrowserSession and controller action passing
Nick Sweetingcb4a5145f22a
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.pyindex 3dda03b19..9154203cb 100644--- a/browser_use/browser/session.py+++ b/browser_use/browser/session.py@@ -1810,6 +1810,10 @@ class BrowserSession(BaseModel):assert self.human_current_page is not Noneassert self.agent_current_page is not None+ # if url: # sometimes this does not pass because JS or HTTP redirects the page really fast+ # assert self.agent_current_page.url == url+ # else:+ # assert self.agent_current_page.url == 'about:blank'return new_pagediff --git a/browser_use/controller/registry/service.py b/browser_use/controller/registry/service.pyindex 58a0a49ef..8caf5a5c1 100644--- a/browser_use/controller/registry/service.py+++ b/browser_use/controller/registry/service.py@@ -167,7 +167,7 @@ class Registry(Generic[Context]):extra_args['has_sensitive_data'] = Trueif is_pydantic:return await action.function(validated_params, **extra_args)- return await action.function(**validated_params.model_dump(), **extra_args)+ return await action.function(**{**validated_params.model_dump(), **extra_args})except Exception as e:raise RuntimeError(f'Error executing action {action_name}: {str(e)}') from e