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
Remove context
Magnus Müller49ea4ff03a92
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 9a31a4b21..38bf74bff 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -167,7 +167,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):max_history_items: int | None = None,page_extraction_llm: BaseChatModel | None = None,injected_agent_state: AgentState | None = None,- context: Context | None = None,source: str | None = None,file_system_path: str | None = None,task_id: str | None = None,@@ -390,9 +389,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.register_done_callback = register_done_callbackself.register_external_agent_status_raise_error_callback = register_external_agent_status_raise_error_callback- # Context- self.context: Context | None = context-# Telemetryself.telemetry = ProductTelemetry()@@ -1573,7 +1569,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):page_extraction_llm=self.settings.page_extraction_llm,sensitive_data=self.sensitive_data,available_file_paths=self.available_file_paths,- context=self.context,)time_end = time.time()diff --git a/browser_use/tools/registry/service.py b/browser_use/tools/registry/service.pyindex 43333cc2d..ebce37c0a 100644--- a/browser_use/tools/registry/service.py+++ b/browser_use/tools/registry/service.py@@ -316,8 +316,6 @@ class Registry(Generic[Context]):file_system: FileSystem | None = None,sensitive_data: dict[str, str | dict[str, str]] | None = None,available_file_paths: list[str] | None = None,- #- context: Context | None = None,) -> Any:"""Execute a registered action with simplified parameter handling"""if action_name not in self.registry.actions:@@ -348,7 +346,6 @@ class Registry(Generic[Context]):# Build special context dictspecial_context = {- 'context': context,'browser_session': browser_session,'page_extraction_llm': page_extraction_llm,'available_file_paths': available_file_paths,diff --git a/browser_use/tools/service.py b/browser_use/tools/service.pyindex 1af1863d2..68bbdcb8e 100644--- a/browser_use/tools/service.py+++ b/browser_use/tools/service.py@@ -1082,8 +1082,6 @@ Provide the extracted information in a clear, structured format."""sensitive_data: dict[str, str | dict[str, str]] | None = None,available_file_paths: list[str] | None = None,file_system: FileSystem | None = None,- #- context: Context | None = None,) -> ActionResult:"""Execute an action"""@@ -1115,7 +1113,6 @@ Provide the extracted information in a clear, structured format."""file_system=file_system,sensitive_data=sensitive_data,available_file_paths=available_file_paths,- context=context,)except Exception as e:# Log the original exception with traceback for observability