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 planner llm
Magnus Müller147ed30d0299
diff --git a/.github/ISSUE_TEMPLATE/1_element_detection_bug.yml b/.github/ISSUE_TEMPLATE/1_element_detection_bug.ymlindex 2ff1cefab..126a127e3 100644--- a/.github/ISSUE_TEMPLATE/1_element_detection_bug.yml+++ b/.github/ISSUE_TEMPLATE/1_element_detection_bug.yml@@ -131,8 +131,4 @@ body:$ python /app/browser-use/examples/browser/real_browser.pyDEBUG [browser] 🌎 Initializing new browserDEBUG [agent] Version: 0.1.46-9-g62760ba, Source: git- INFO [agent] 🧠 Starting an agent with main_model=gpt-4o +tools +vision +memory, planner_model=None, extraction_model=gpt-4o- DEBUG [agent] Verifying the ChatOpenAI LLM knows the capital of France...- DEBUG [langsmith.client] Sending multipart request with context: trace=91282a01-6667-48a1-8cd7-21aa9337a580,id=91282a01-6667-48a1-8cd7-21aa9337a580- DEBUG [agent] 🪪 LLM API keys OPENAI_API_KEY work, ChatOpenAI model is connected & responding correctly.- ...+diff --git a/.github/ISSUE_TEMPLATE/2_bug_report.yml b/.github/ISSUE_TEMPLATE/2_bug_report.ymlindex da424def9..d67aeb9fc 100644--- a/.github/ISSUE_TEMPLATE/2_bug_report.yml+++ b/.github/ISSUE_TEMPLATE/2_bug_report.yml@@ -107,9 +107,3 @@ body:placeholder: |$ python /app/browser-use/examples/browser/real_browser.pyDEBUG [browser] 🌎 Initializing new browser- DEBUG [agent] Version: 0.1.46-9-g62760ba, Source: git- INFO [agent] 🧠 Starting an agent with main_model=gpt-4o +tools +vision +memory, planner_model=None, extraction_model=gpt-4o- DEBUG [agent] Verifying the ChatOpenAI LLM knows the capital of France...- DEBUG [langsmith.client] Sending multipart request with context: trace=91282a01-6667-48a1-8cd7-21aa9337a580,id=91282a01-6667-48a1-8cd7-21aa9337a580- DEBUG [agent] 🪪 LLM API keys OPENAI_API_KEY work, ChatOpenAI model is connected & responding correctly.- ...diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex b24ee9624..578081224 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -153,7 +153,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):# Agent settingsoutput_model_schema: type[AgentStructuredOutput] | None = None,use_vision: bool = True,- use_vision_for_planner: bool = False, # Deprecatedsave_conversation_path: str | Path | None = None,save_conversation_path_encoding: str | None = 'utf-8',max_failures: int = 3,@@ -169,10 +168,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):flash_mode: bool = False,max_history_items: int | None = None,page_extraction_llm: BaseChatModel | None = None,- planner_llm: BaseChatModel | None = None, # Deprecated- planner_interval: int = 1, # Deprecated- is_planner_reasoning: bool = False, # Deprecated- extend_planner_system_message: str | None = None, # Deprecatedinjected_agent_state: AgentState | None = None,context: Context | None = None,source: str | None = None,@@ -191,20 +186,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):):if not isinstance(llm, BaseChatModel):raise ValueError('invalid llm, must be from browser_use.llm')- # Check for deprecated planner parameters- planner_params = [- planner_llm,- use_vision_for_planner,- is_planner_reasoning,- extend_planner_system_message,- ]- if any(param is not None and param is not False for param in planner_params) or planner_interval != 1:- logger.warning(- '⚠️ Planner functionality has been removed in browser-use v0.3.3+. '- 'The planner_llm, use_vision_for_planner, planner_interval, is_planner_reasoning, '- 'and extend_planner_system_message parameters are deprecated and will be ignored. '- 'Please remove these parameters from your Agent() initialization.'- )# Check for deprecated memory parametersif kwargs.get('enable_memory', False) or kwargs.get('memory_config') is not None:@@ -225,6 +206,18 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.task_id: str = self.idself.session_id: str = uuid7str()+ browser_profile = browser_profile or DEFAULT_BROWSER_PROFILE++ # Handle browser vs browser_session parameter (browser takes precedence)+ if browser and browser_session:+ raise ValueError('Cannot specify both "browser" and "browser_session" parameters. Use "browser" for the cleaner API.')+ browser_session = browser or browser_session++ self.browser_session = browser_session or BrowserSession(+ browser_profile=browser_profile,+ id=uuid7str()[:-4] + self.id[-4:], # re-use the same 4-char suffix so they show up together in logs+ )+# Initialize available file paths as direct attributeself.available_file_paths = available_file_paths@@ -250,7 +243,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.settings = AgentSettings(use_vision=use_vision,vision_detail_level=vision_detail_level,- use_vision_for_planner=False, # Always False now (deprecated)save_conversation_path=save_conversation_path,save_conversation_path_encoding=save_conversation_path_encoding,max_failures=max_failures,@@ -265,10 +257,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):flash_mode=flash_mode,max_history_items=max_history_items,page_extraction_llm=page_extraction_llm,- planner_llm=None, # Always None now (deprecated)- planner_interval=1, # Always 1 now (deprecated)- is_planner_reasoning=False, # Always False now (deprecated)- extend_planner_system_message=None, # Always None now (deprecated)calculate_cost=calculate_cost,include_tool_call_examples=include_tool_call_examples,llm_timeout=llm_timeout,@@ -279,7 +267,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.token_cost_service = TokenCost(include_cost=calculate_cost)self.token_cost_service.register_llm(llm)self.token_cost_service.register_llm(page_extraction_llm)- # Note: No longer registering planner_llm (deprecated)# Initialize stateself.state = injected_agent_state or AgentState()@@ -311,13 +298,11 @@ class Agent(Generic[Context, AgentStructuredOutput]):if 'deepseek' in self.llm.model.lower():self.logger.warning('⚠️ DeepSeek models do not support use_vision=True yet. Setting use_vision=False for now...')self.settings.use_vision = False- # Note: No longer checking planner_llm for DeepSeek (deprecated)# Handle users trying to use use_vision=True with XAI modelsif 'grok' in self.llm.model.lower():self.logger.warning('⚠️ XAI models do not support use_vision=True yet. Setting use_vision=False for now...')self.settings.use_vision = False- # Note: No longer checking planner_llm for XAI models (deprecated)self.logger.info(f'🧠 Starting a browser-use version {self.version} with model={self.llm.model}')logger.debug(@@ -354,18 +339,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):include_recent_events=self.include_recent_events,)- browser_profile = browser_profile or DEFAULT_BROWSER_PROFILE-- # Handle browser vs browser_session parameter (browser takes precedence)- if browser and browser_session:- raise ValueError('Cannot specify both "browser" and "browser_session" parameters. Use "browser" for the cleaner API.')- browser_session = browser or browser_session-- self.browser_session = browser_session or BrowserSession(- browser_profile=browser_profile,- id=uuid7str()[:-4] + self.id[-4:], # re-use the same 4-char suffix so they show up together in logs- )-if self.sensitive_data:# Check if sensitive_data has domain-specific credentialshas_domain_specific_credentials = any(isinstance(v, dict) for v in self.sensitive_data.values())@@ -601,20 +574,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.version = versionself.source = source- # def _set_model_names(self) -> None:- # self.chat_model_library = self.llm.provider- # self.model_name = self.llm.model-- # if self.settings.planner_llm:- # if hasattr(self.settings.planner_llm, 'model_name'):- # self.planner_model_name = self.settings.planner_llm.model_name # type: ignore- # elif hasattr(self.settings.planner_llm, 'model'):- # self.planner_model_name = self.settings.planner_llm.model # type: ignore- # else:- # self.planner_model_name = 'Unknown'- # else:- # self.planner_model_name = None-def _setup_action_models(self) -> None:"""Setup dynamic action models from tools's registry"""# Initially only include actions with no filters@@ -1177,7 +1136,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):task=self.task,model=self.llm.model,model_provider=self.llm.provider,- planner_llm=self.settings.planner_llm.model if self.settings.planner_llm else None,max_steps=max_steps,max_actions_per_step=self.settings.max_actions_per_step,use_vision=self.settings.use_vision,diff --git a/browser_use/agent/views.py b/browser_use/agent/views.pyindex 927667f8c..f1b7c1120 100644--- a/browser_use/agent/views.py+++ b/browser_use/agent/views.py@@ -32,7 +32,6 @@ class AgentSettings(BaseModel):use_vision: bool = Truevision_detail_level: Literal['auto', 'low', 'high'] = 'auto'- use_vision_for_planner: bool = Falsesave_conversation_path: str | Path | None = Nonesave_conversation_path_encoding: str | None = 'utf-8'max_failures: int = 3@@ -48,10 +47,6 @@ class AgentSettings(BaseModel):max_history_items: int | None = Nonepage_extraction_llm: BaseChatModel | None = None- planner_llm: BaseChatModel | None = None- planner_interval: int = 1 # Run planner every N steps- is_planner_reasoning: bool = False # type: ignore- extend_planner_system_message: str | None = Nonecalculate_cost: bool = Falseinclude_tool_call_examples: bool = Falsellm_timeout: int = 60 # Timeout in seconds for LLM callsdiff --git a/browser_use/telemetry/views.py b/browser_use/telemetry/views.pyindex 43f9ce4d9..690aee3fd 100644--- a/browser_use/telemetry/views.py+++ b/browser_use/telemetry/views.py@@ -27,7 +27,6 @@ class AgentTelemetryEvent(BaseTelemetryEvent):task: strmodel: strmodel_provider: str- planner_llm: str | Nonemax_steps: intmax_actions_per_step: intuse_vision: bool