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
Rename Controller to Tools
Magnus Müller2a83442f172a
diff --git a/browser_use/__init__.py b/browser_use/__init__.pyindex 9bc489531..57f9a329a 100644--- a/browser_use/__init__.py+++ b/browser_use/__init__.py@@ -50,7 +50,7 @@ if TYPE_CHECKING:from browser_use.agent.views import ActionModel, ActionResult, AgentHistoryListfrom browser_use.browser import BrowserProfile, BrowserSessionfrom browser_use.browser import BrowserSession as Browser- from browser_use.controller.service import Controller+ from browser_use.controller.service import Toolsfrom browser_use.dom.service import DomServicefrom browser_use.llm.anthropic.chat import ChatAnthropicfrom browser_use.llm.azure.chat import ChatAzureOpenAI@@ -111,7 +111,7 @@ __all__ = ['BrowserSession','Browser', # Alias for BrowserSession'BrowserProfile',- 'Controller',+ 'Tools','DomService','SystemPrompt','ActionResult',@@ -124,4 +124,5 @@ __all__ = ['ChatGroq','ChatAzureOpenAI','ChatOllama',+ 'Tools',]diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 727286145..5b08a045e 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -59,7 +59,7 @@ from browser_use.browser.session import DEFAULT_BROWSER_PROFILEfrom browser_use.browser.views import BrowserStateSummaryfrom browser_use.config import CONFIGfrom browser_use.controller.registry.views import ActionModel-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.dom.views import DOMInteractedElementfrom browser_use.filesystem.file_system import FileSystemfrom browser_use.observability import observe, observe_debug@@ -136,7 +136,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):browser_profile: BrowserProfile | None = None,browser_session: BrowserSession | None = None,browser: Browser | None = None, # Alias for browser_session (cleaner naming)- controller: Controller[Context] | None = None,+ controller: Tools[Context] | None = None,# Initial agent run parameterssensitive_data: dict[str, str | dict[str, str]] | None = None,initial_actions: list[dict[str, dict[str, Any]]] | None = None,@@ -238,9 +238,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):self.llm = llmself.preload = preloadself.include_recent_events = include_recent_events- self.controller = (- controller if controller is not None else Controller(display_files_in_done_text=display_files_in_done_text)- )+ self.controller = controller if controller is not None else Tools(display_files_in_done_text=display_files_in_done_text)# Structured outputself.output_model_schema = output_model_schemadiff --git a/browser_use/cli.py b/browser_use/cli.pyindex 6e8fcc140..62d8d7d80 100644--- a/browser_use/cli.py+++ b/browser_use/cli.py@@ -39,7 +39,7 @@ except ImportError:os.environ['BROWSER_USE_LOGGING_LEVEL'] = 'result'-from browser_use import Agent, Controller+from browser_use import Agent, Toolsfrom browser_use.agent.views import AgentSettingsfrom browser_use.browser import BrowserProfile, BrowserSessionfrom browser_use.config import CONFIG@@ -449,7 +449,7 @@ class BrowserUseApp(App):super().__init__(*args, **kwargs)self.config = configself.browser_session: BrowserSession | None = None # Will be set before app.run_async()- self.controller: Controller | None = None # Will be set before app.run_async()+ self.controller: Tools | None = None # Will be set before app.run_async()self.agent: Agent | None = Noneself.llm: Any | None = None # Will be set before app.run_async()self.task_history = config.get('command_history', [])@@ -855,7 +855,7 @@ class BrowserUseApp(App):self.agent = Agent(task=task,llm=self.llm,- controller=self.controller if self.controller else Controller(),+ controller=self.controller if self.controller else Tools(),browser_session=self.browser_session,source='cli',**agent_settings.model_dump(),@@ -1520,7 +1520,7 @@ async def textual_interface(config: dict[str, Any]):# Step 3: Initialize Controllerlogger.debug('Initializing Controller...')try:- controller = Controller()+ controller = Tools()logger.debug('Controller initialized successfully')except Exception as e:logger.error(f'Error initializing Controller: {str(e)}', exc_info=True)diff --git a/browser_use/controller/service.py b/browser_use/controller/service.pyindex bd37e07a6..84e2fb886 100644--- a/browser_use/controller/service.py+++ b/browser_use/controller/service.py@@ -87,7 +87,7 @@ def extract_llm_error_message(error: Exception) -> str:return error_str-class Controller(Generic[Context]):+class Tools(Generic[Context]):def __init__(self,exclude_actions: list[str] = [],@@ -1125,3 +1125,7 @@ Provide the extracted information in a clear, structured format."""else:raise ValueError(f'Invalid action result type: {type(result)} of {result}')return ActionResult()+++# Alias for backwards compatibility+Controller = Toolsdiff --git a/browser_use/integrations/gmail/actions.py b/browser_use/integrations/gmail/actions.pyindex 461ac5a8e..60deeb801 100644--- a/browser_use/integrations/gmail/actions.py+++ b/browser_use/integrations/gmail/actions.py@@ -9,7 +9,7 @@ import loggingfrom pydantic import BaseModel, Fieldfrom browser_use.agent.views import ActionResult-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom .service import GmailService@@ -27,8 +27,8 @@ class GetRecentEmailsParams(BaseModel):def register_gmail_actions(- controller: Controller, gmail_service: GmailService | None = None, access_token: str | None = None-) -> Controller:+ controller: Tools, gmail_service: GmailService | None = None, access_token: str | None = None+) -> Tools:"""Register Gmail actions with the provided controllerArgs:diff --git a/browser_use/mcp/client.py b/browser_use/mcp/client.pyindex 9aa786494..fbddb32bd 100644--- a/browser_use/mcp/client.py+++ b/browser_use/mcp/client.py@@ -31,7 +31,7 @@ from pydantic import BaseModel, ConfigDict, Field, create_modelfrom browser_use.agent.views import ActionResultfrom browser_use.controller.registry.service import Registry-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.telemetry import MCPClientTelemetryEvent, ProductTelemetryfrom browser_use.utils import get_browser_use_version@@ -209,7 +209,7 @@ class MCPClient:async def register_to_controller(self,- controller: Controller,+ controller: Tools,tool_filter: list[str] | None = None,prefix: str | None = None,) -> None:diff --git a/browser_use/mcp/server.py b/browser_use/mcp/server.pyindex a077d5cbe..62cfb1e2d 100644--- a/browser_use/mcp/server.py+++ b/browser_use/mcp/server.py@@ -78,7 +78,7 @@ _configure_mcp_server_logging()from browser_use import ActionModel, Agentfrom browser_use.browser import BrowserProfile, BrowserSessionfrom browser_use.config import get_default_llm, get_default_profile, load_browser_use_config-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.filesystem.file_system import FileSystemfrom browser_use.llm.openai.chat import ChatOpenAI@@ -186,7 +186,7 @@ class BrowserUseServer:self.config = load_browser_use_config()self.agent: Agent | None = Noneself.browser_session: BrowserSession | None = None- self.controller: Controller | None = None+ self.controller: Tools | None = Noneself.llm: ChatOpenAI | None = Noneself.file_system: FileSystem | None = Noneself._telemetry = ProductTelemetry()@@ -488,7 +488,7 @@ class BrowserUseServer:await self.browser_session.start()# Create controller for direct actions- self.controller = Controller()+ self.controller = Tools()# Initialize LLM from configllm_config = get_default_llm(self.config)diff --git a/examples/browser/using_cdp.py b/examples/browser/using_cdp.pyindex 1b671d835..916dfb73c 100644--- a/examples/browser/using_cdp.py+++ b/examples/browser/using_cdp.py@@ -21,7 +21,7 @@ from dotenv import load_dotenvload_dotenv()-from browser_use import Agent, Controller+from browser_use import Agent, Toolsfrom browser_use.browser import BrowserProfile, BrowserSessionfrom browser_use.llm import ChatOpenAI@@ -32,7 +32,7 @@ browser_session = BrowserSession(cdp_url='http://localhost:9222',is_local=True, # set to False if you want to use a remote browser)-controller = Controller()+controller = Tools()async def main():diff --git a/examples/custom-functions/2fa.py b/examples/custom-functions/2fa.pyindex 361e5d424..0f0622c24 100644--- a/examples/custom-functions/2fa.py+++ b/examples/custom-functions/2fa.py@@ -11,14 +11,14 @@ load_dotenv()import pyotp # type: ignore-from browser_use import ActionResult, Agent, ChatOpenAI, Controller+from browser_use import ActionResult, Agent, ChatOpenAI, Tools# Set up logginglogging.basicConfig(level=logging.INFO)logger = logging.getLogger(__name__)-controller = Controller()+controller = Tools()@controller.registry.action('Get 2FA code from when OTP is required')diff --git a/examples/custom-functions/action_filters.py b/examples/custom-functions/action_filters.pyindex e05c8fe9e..b4e1d865c 100644--- a/examples/custom-functions/action_filters.py+++ b/examples/custom-functions/action_filters.py@@ -28,11 +28,11 @@ from dotenv import load_dotenvload_dotenv()from browser_use import ChatOpenAI-from browser_use.agent.service import Agent, Controller+from browser_use.agent.service import Agent, Toolsfrom browser_use.browser import BrowserSession# Initialize controller and registry-controller = Controller()+controller = Tools()registry = controller.registrydiff --git a/examples/custom-functions/advanced_search.py b/examples/custom-functions/advanced_search.pyindex 58f37a085..455356418 100644--- a/examples/custom-functions/advanced_search.py+++ b/examples/custom-functions/advanced_search.py@@ -14,7 +14,7 @@ import loggingfrom pydantic import BaseModel-from browser_use import ActionResult, Agent, ChatOpenAI, Controller+from browser_use import ActionResult, Agent, ChatOpenAI, Toolsfrom browser_use.browser.profile import BrowserProfilelogger = logging.getLogger(__name__)@@ -33,7 +33,7 @@ SERP_API_KEY = os.getenv('SERPER_API_KEY')if not SERP_API_KEY:raise ValueError('SERPER_API_KEY is not set')-controller = Controller(exclude_actions=['search_google'], output_model=PersonList)+controller = Tools(exclude_actions=['search_google'], output_model=PersonList)@controller.registry.action('Search the web for a specific query. Returns a short description and links of the results.')diff --git a/examples/custom-functions/cua.py b/examples/custom-functions/cua.pyindex 85ad70325..f41f2c300 100644--- a/examples/custom-functions/cua.py+++ b/examples/custom-functions/cua.py@@ -24,7 +24,7 @@ load_dotenv()from openai import AsyncOpenAIfrom pydantic import BaseModel, Field-from browser_use import Agent, ChatOpenAI, Controller+from browser_use import Agent, ChatOpenAI, Toolsfrom browser_use.agent.views import ActionResultfrom browser_use.browser import BrowserSession@@ -177,7 +177,7 @@ async def handle_model_action(browser_session: BrowserSession, action) -> Actionreturn ActionResult(error=ERROR_MSG)-controller = Controller()+controller = Tools()@controller.registry.action(diff --git a/examples/custom-functions/file_upload.py b/examples/custom-functions/file_upload.pyindex f147b3166..9f856eaad 100644--- a/examples/custom-functions/file_upload.py+++ b/examples/custom-functions/file_upload.py@@ -18,7 +18,7 @@ from dotenv import load_dotenvload_dotenv()from browser_use import ChatOpenAI-from browser_use.agent.service import Agent, Controller+from browser_use.agent.service import Agent, Toolsfrom browser_use.agent.views import ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.events import UploadFileEvent@@ -26,7 +26,7 @@ from browser_use.browser.events import UploadFileEventlogger = logging.getLogger(__name__)# Initialize controller-controller = Controller()+controller = Tools()@controller.action('Upload file to interactive element with file path')diff --git a/examples/custom-functions/notification.py b/examples/custom-functions/notification.pyindex a0677b606..efb423129 100644--- a/examples/custom-functions/notification.py+++ b/examples/custom-functions/notification.py@@ -8,9 +8,9 @@ from dotenv import load_dotenvload_dotenv()-from browser_use import ActionResult, Agent, ChatOpenAI, Controller+from browser_use import ActionResult, Agent, ChatOpenAI, Tools-controller = Controller()+controller = Tools()@controller.registry.action('Done with task ')diff --git a/examples/custom-functions/onepassword_2fa.py b/examples/custom-functions/onepassword_2fa.pyindex 0ae1ff728..db0955359 100644--- a/examples/custom-functions/onepassword_2fa.py+++ b/examples/custom-functions/onepassword_2fa.py@@ -11,7 +11,7 @@ load_dotenv()from onepassword.client import Client # type: ignore # pip install onepassword-sdk-from browser_use import ActionResult, Agent, ChatOpenAI, Controller+from browser_use import ActionResult, Agent, ChatOpenAI, Tools# Set up logginglogging.basicConfig(level=logging.INFO)@@ -21,7 +21,7 @@ OP_SERVICE_ACCOUNT_TOKEN = os.getenv('OP_SERVICE_ACCOUNT_TOKEN')OP_ITEM_ID = os.getenv('OP_ITEM_ID') # Go to 1Password, right click on the item, click "Copy Secret Reference"-controller = Controller()+controller = Tools()@controller.registry.action('Get 2FA code from 1Password for Google Account', domains=['*.google.com', 'google.com'])diff --git a/examples/custom-functions/save_to_file_hugging_face.py b/examples/custom-functions/save_to_file_hugging_face.pyindex 071e15f44..5c65dfcb9 100644--- a/examples/custom-functions/save_to_file_hugging_face.py+++ b/examples/custom-functions/save_to_file_hugging_face.py@@ -12,10 +12,10 @@ from pydantic import BaseModelfrom browser_use import ChatOpenAIfrom browser_use.agent.service import Agent-from browser_use.controller.service import Controller+from browser_use.controller.service import Tools# Initialize controller first-controller = Controller()+controller = Tools()class Model(BaseModel):diff --git a/examples/integrations/gmail_2fa_integration.py b/examples/integrations/gmail_2fa_integration.pyindex ac1effc31..ab0e288bd 100644--- a/examples/integrations/gmail_2fa_integration.py+++ b/examples/integrations/gmail_2fa_integration.py@@ -28,7 +28,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(load_dotenv()-from browser_use import Agent, ChatOpenAI, Controller+from browser_use import Agent, ChatOpenAI, Toolsfrom browser_use.config import CONFIGfrom browser_use.integrations.gmail import GmailService, register_gmail_actions@@ -244,7 +244,7 @@ async def main():# Step 3: Initialize controller with authenticated serviceprint('\n🔍 Step 3: Registering Gmail actions...')- controller = Controller()+ controller = Tools()register_gmail_actions(controller, gmail_service=gmail_service)print('✅ Gmail actions registered with controller')diff --git a/examples/mcp/advanced_client.py b/examples/mcp/advanced_client.pyindex b58e4ac7a..9100307ea 100644--- a/examples/mcp/advanced_client.py+++ b/examples/mcp/advanced_client.py@@ -12,7 +12,7 @@ This example demonstrates how to:import asyncioimport os-from browser_use import Agent, Controller+from browser_use import Agent, Toolsfrom browser_use.llm.openai.chat import ChatOpenAIfrom browser_use.mcp.client import MCPClient@@ -21,7 +21,7 @@ async def main():"""Sign up for account, save details, and verify via Gmail."""# Initialize controller- controller = Controller()+ controller = Tools()# Connect to Gmail MCP Server# Requires Gmail API credentials - see: https://github.com/GongRzhe/Gmail-MCP-Server#setupdiff --git a/examples/mcp/simple_client.py b/examples/mcp/simple_client.pyindex 6e9c3fd7a..0b79faaeb 100644--- a/examples/mcp/simple_client.py+++ b/examples/mcp/simple_client.py@@ -7,14 +7,14 @@ This example shows how to connect to an MCP server and use its tools with an ageimport asyncioimport os-from browser_use import Agent, Controller+from browser_use import Agent, Toolsfrom browser_use.llm.openai.chat import ChatOpenAIfrom browser_use.mcp.client import MCPClientasync def main():# Initialize controller- controller = Controller()+ controller = Tools()# Connect to a filesystem MCP server# This server provides tools to read/write files in a directorydiff --git a/examples/ui/command_line.py b/examples/ui/command_line.pyindex 9cf58915e..49fdecf0d 100644--- a/examples/ui/command_line.py+++ b/examples/ui/command_line.py@@ -26,7 +26,7 @@ load_dotenv()from browser_use import Agentfrom browser_use.browser import BrowserSession-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsdef get_llm(provider: str):@@ -70,7 +70,7 @@ def parse_arguments():def initialize_agent(query: str, provider: str):"""Initialize the browser agent with the given query and provider."""llm = get_llm(provider)- controller = Controller()+ controller = Tools()browser_session = BrowserSession()return Agent(diff --git a/examples/ui/streamlit_demo.py b/examples/ui/streamlit_demo.pyindex 98485a670..4580eb73f 100644--- a/examples/ui/streamlit_demo.py+++ b/examples/ui/streamlit_demo.py@@ -19,7 +19,7 @@ import streamlit as st # type: ignorefrom browser_use import Agentfrom browser_use.browser import BrowserSession-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsif os.name == 'nt':asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())@@ -54,7 +54,7 @@ def get_llm(provider: str):# Function to initialize the agentdef initialize_agent(query: str, provider: str):llm = get_llm(provider)- controller = Controller()+ controller = Tools()browser_session = BrowserSession()return Agent(diff --git a/examples/use-cases/check_appointment.py b/examples/use-cases/check_appointment.pyindex d4dfd1377..e41fa5bd1 100644--- a/examples/use-cases/check_appointment.py+++ b/examples/use-cases/check_appointment.py@@ -14,12 +14,12 @@ from pydantic import BaseModelfrom browser_use import ChatOpenAIfrom browser_use.agent.service import Agent-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsif not os.getenv('OPENAI_API_KEY'):raise ValueError('OPENAI_API_KEY is not set. Please add it to your environment variables.')-controller = Controller()+controller = Tools()class WebpageInfo(BaseModel):diff --git a/examples/use-cases/find_and_apply_to_jobs.py b/examples/use-cases/find_and_apply_to_jobs.pyindex 58323eab7..4e6b5e06a 100644--- a/examples/use-cases/find_and_apply_to_jobs.py+++ b/examples/use-cases/find_and_apply_to_jobs.py@@ -21,7 +21,7 @@ load_dotenv()from pydantic import BaseModelfrom PyPDF2 import PdfReader # type: ignore-from browser_use import ActionResult, Agent, ChatOpenAI, Controller+from browser_use import ActionResult, Agent, ChatOpenAI, Toolsfrom browser_use.browser import BrowserProfile, BrowserSessionrequired_env_vars = ['AZURE_OPENAI_KEY', 'AZURE_OPENAI_ENDPOINT']@@ -31,7 +31,7 @@ for var in required_env_vars:logger = logging.getLogger(__name__)# full screen mode-controller = Controller()+controller = Tools()# NOTE: This is the path to your cv file# create a dummy cvdiff --git a/examples/use-cases/find_influencer_profiles.py b/examples/use-cases/find_influencer_profiles.pyindex 64645492c..42ec28541 100644--- a/examples/use-cases/find_influencer_profiles.py+++ b/examples/use-cases/find_influencer_profiles.py@@ -18,7 +18,7 @@ load_dotenv()import httpxfrom pydantic import BaseModel-from browser_use import Agent, ChatOpenAI, Controller+from browser_use import Agent, ChatOpenAI, Toolsfrom browser_use.agent.views import ActionResult@@ -31,7 +31,7 @@ class Profiles(BaseModel):profiles: list[Profile]-controller = Controller(exclude_actions=['search_google'], output_model=Profiles)+controller = Tools(exclude_actions=['search_google'], output_model=Profiles)BEARER_TOKEN = os.getenv('BEARER_TOKEN')if not BEARER_TOKEN:diff --git a/tests/ci/conftest.py b/tests/ci/conftest.pyindex 25d0333aa..a1d064f21 100644--- a/tests/ci/conftest.py+++ b/tests/ci/conftest.py@@ -20,7 +20,7 @@ socketserver.ThreadingMixIn.block_on_close = Falsesocketserver.ThreadingMixIn.daemon_threads = Truefrom browser_use.agent.views import AgentOutput-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.llm import BaseChatModelfrom browser_use.llm.views import ChatInvokeCompletion@@ -84,7 +84,7 @@ def create_mock_llm(actions: list[str] | None = None) -> BaseChatModel:Returns:Mock LLM that will return the actions in order, or just a done action if no actions provided."""- controller = Controller()+ controller = Tools()ActionModel = controller.registry.create_action_model()AgentOutputWithActions = AgentOutput.type_with_custom_actions(ActionModel)diff --git a/tests/ci/test_browser_event_ClickElementEvent.py b/tests/ci/test_browser_event_ClickElementEvent.pyindex b95446ef0..bf3be7ed0 100644--- a/tests/ci/test_browser_event_ClickElementEvent.py+++ b/tests/ci/test_browser_event_ClickElementEvent.py@@ -8,7 +8,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import (ClickElementAction,GoToUrlAction,@@ -66,7 +66,7 @@ async def browser_session():@pytest.fixture(scope='function')def controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestClickElementEvent:diff --git a/tests/ci/test_browser_event_GetDropdownOptionsEvent.py b/tests/ci/test_browser_event_GetDropdownOptionsEvent.pyindex 544646b2d..ae09a6e83 100644--- a/tests/ci/test_browser_event_GetDropdownOptionsEvent.py+++ b/tests/ci/test_browser_event_GetDropdownOptionsEvent.py@@ -13,7 +13,7 @@ from browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.events import GetDropdownOptionsEvent, NavigationCompleteEvent, SelectDropdownOptionEventfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import GoToUrlAction@@ -268,7 +268,7 @@ async def browser_session():@pytest.fixture(scope='function')def controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestGetDropdownOptionsEvent:diff --git a/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py b/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.pyindex c79dc10d7..24a155181 100644--- a/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py+++ b/tests/ci/test_browser_event_GetDropdownOptionsEvent_aria_menus.py@@ -4,7 +4,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import GoToUrlAction@@ -142,7 +142,7 @@ async def browser_session():@pytest.fixture(scope='function')def controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestARIAMenuDropdown:diff --git a/tests/ci/test_browser_event_NavigateToUrlEvent.py b/tests/ci/test_browser_event_NavigateToUrlEvent.pyindex 6ea9cbb22..492ac33d5 100644--- a/tests/ci/test_browser_event_NavigateToUrlEvent.py+++ b/tests/ci/test_browser_event_NavigateToUrlEvent.py@@ -6,7 +6,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import GoToUrlAction@@ -55,7 +55,7 @@ async def browser_session():@pytest.fixturedef controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestNavigateToUrlEvent:diff --git a/tests/ci/test_browser_event_ScrollEvent.py b/tests/ci/test_browser_event_ScrollEvent.pyindex 5ac7a2e9a..09fc3a955 100644--- a/tests/ci/test_browser_event_ScrollEvent.py+++ b/tests/ci/test_browser_event_ScrollEvent.py@@ -6,7 +6,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import (GoToUrlAction,ScrollAction,@@ -73,7 +73,7 @@ async def browser_session():@pytest.fixturedef controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestScrollActions:diff --git a/tests/ci/test_browser_event_TypeTextEvent.py b/tests/ci/test_browser_event_TypeTextEvent.pyindex 645408991..0dc27c84f 100644--- a/tests/ci/test_browser_event_TypeTextEvent.py+++ b/tests/ci/test_browser_event_TypeTextEvent.py@@ -6,7 +6,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import (GoToUrlAction,InputTextAction,@@ -70,7 +70,7 @@ async def browser_session():@pytest.fixturedef controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestTypeTextEvent:diff --git a/tests/ci/test_browser_event_TypeTextEvent2.py b/tests/ci/test_browser_event_TypeTextEvent2.pyindex 645408991..0dc27c84f 100644--- a/tests/ci/test_browser_event_TypeTextEvent2.py+++ b/tests/ci/test_browser_event_TypeTextEvent2.py@@ -6,7 +6,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import (GoToUrlAction,InputTextAction,@@ -70,7 +70,7 @@ async def browser_session():@pytest.fixturedef controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestTypeTextEvent:diff --git a/tests/ci/test_browser_session_element_cache.py b/tests/ci/test_browser_session_element_cache.pyindex 648788ebd..80c647579 100644--- a/tests/ci/test_browser_session_element_cache.py+++ b/tests/ci/test_browser_session_element_cache.py@@ -9,7 +9,7 @@ pytest.skip('TODO: fix - uses removed get_current_page method', allow_module_levfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Tools@pytest.fixture@@ -76,7 +76,7 @@ async def browser_session():@pytest.fixturedef controller():"""Create a controller instance."""- return Controller()+ return Tools()@pytest.mark.asynciodiff --git a/tests/ci/test_browser_session_tab_management.py b/tests/ci/test_browser_session_tab_management.pyindex 49bc9efdb..cd9181f54 100644--- a/tests/ci/test_browser_session_tab_management.py+++ b/tests/ci/test_browser_session_tab_management.py@@ -13,7 +13,7 @@ load_dotenv()from browser_use.agent.views import ActionModelfrom browser_use.browser.profile import BrowserProfilefrom browser_use.browser.session import BrowserSession-from browser_use.controller.service import Controller+from browser_use.controller.service import Tools# Set up test logginglogger = logging.getLogger('tab_tests')@@ -86,7 +86,7 @@ async def browser_session(base_url):@pytest.fixture(scope='module')def controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestTabManagement:diff --git a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.pyindex 131f57586..398e52c7e 100644--- a/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py+++ b/tests/ci/test_browser_watchdog_downloads_upload_full_circle.py@@ -12,7 +12,7 @@ from browser_use.agent.views import ActionModelfrom browser_use.browser import BrowserSessionfrom browser_use.browser.events import BrowserStateRequestEvent, FileDownloadedEventfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import ClickElementAction, GoToUrlAction, UploadFileActionfrom browser_use.filesystem.file_system import FileSystem@@ -152,7 +152,7 @@ class TestDownloadUploadFullCircle:await browser_session.start()# Create controller and file system- controller = Controller()+ controller = Tools()file_system = FileSystem(base_dir=tmpdir)try:diff --git a/tests/ci/test_controller.py b/tests/ci/test_controller.pyindex dfe7b4254..e936dc73b 100644--- a/tests/ci/test_controller.py+++ b/tests/ci/test_controller.py@@ -9,7 +9,7 @@ from pytest_httpserver import HTTPServerfrom browser_use.agent.views import ActionModel, ActionResultfrom browser_use.browser import BrowserSessionfrom browser_use.browser.profile import BrowserProfile-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.controller.views import (DoneAction,GoToUrlAction,@@ -87,7 +87,7 @@ async def browser_session():@pytest.fixture(scope='function')def controller():"""Create and provide a Controller instance."""- return Controller()+ return Tools()class TestControllerIntegration:@@ -353,7 +353,7 @@ class TestControllerIntegration:async def test_excluded_actions(self, browser_session):"""Test that excluded actions are not registered."""# Create controller with excluded actions- excluded_controller = Controller(exclude_actions=['search_google', 'scroll'])+ excluded_controller = Tools(exclude_actions=['search_google', 'scroll'])# Verify excluded actions are not in the registryassert 'search_google' not in excluded_controller.registry.registry.actionsdiff --git a/tests/ci/test_llm_custom_structured_ouput.py b/tests/ci/test_llm_custom_structured_ouput.pyindex d3f31b68d..176dba3d5 100644--- a/tests/ci/test_llm_custom_structured_ouput.py+++ b/tests/ci/test_llm_custom_structured_ouput.py@@ -4,7 +4,7 @@ import osimport tiktokenfrom browser_use.agent.views import AgentOutput-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.llm.schema import SchemaOptimizer@@ -12,7 +12,7 @@ def test_optimized_schema():"""Test the optimized schema generation and save to file."""# Create controller and get all registered actions- controller = Controller()+ controller = Tools()ActionModel = controller.registry.create_action_model()# Create the agent output model with custom actionsdiff --git a/tests/ci/test_llm_schema_optimizer.py b/tests/ci/test_llm_schema_optimizer.pyindex b0cfa3eef..96e8d899c 100644--- a/tests/ci/test_llm_schema_optimizer.py+++ b/tests/ci/test_llm_schema_optimizer.py@@ -6,7 +6,7 @@ optimizes the schemas for agent actions without losing information.from pydantic import BaseModelfrom browser_use.agent.views import AgentOutput-from browser_use.controller.service import Controller+from browser_use.controller.service import Toolsfrom browser_use.llm.schema import SchemaOptimizer@@ -28,7 +28,7 @@ def test_optimizer_preserves_all_fields_in_structured_done_action():"""# 1. Setup a controller with a custom output model, simulating an Agent# being created with an `output_model_schema`.- controller = Controller(output_model=ProductInfo)+ controller = Tools(output_model=ProductInfo)# 2. Get the dynamically created AgentOutput model, which includes all registered actions.ActionModel = controller.registry.create_action_model()diff --git a/tests/ci/test_mcp_client.py b/tests/ci/test_mcp_client.pyindex 952d69010..6aa675285 100644--- a/tests/ci/test_mcp_client.py+++ b/tests/ci/test_mcp_client.py@@ -13,7 +13,7 @@ from mcp.server import NotificationOptions, Serverfrom mcp.server.models import InitializationOptionsfrom pytest_httpserver import HTTPServer-from browser_use import ActionResult, Agent, BrowserProfile, BrowserSession, Controller+from browser_use import ActionResult, Agent, BrowserProfile, BrowserSession, Toolsfrom browser_use.mcp.client import MCPClient@@ -230,7 +230,7 @@ async def test_mcp_server_script():async def test_mcp_client_basic_connection(test_mcp_server_script):"""Test basic MCP client connection and tool discovery."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -286,7 +286,7 @@ async def test_mcp_tools_with_agent(test_mcp_server_script, httpserver: HTTPServbrowser_session = BrowserSession(browser_profile=BrowserProfile(headless=True, user_data_dir=None, keep_alive=True))await browser_session.start()- controller = Controller()+ controller = Tools()# Connect MCP clientmcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -348,7 +348,7 @@ async def test_mcp_tools_with_agent(test_mcp_server_script, httpserver: HTTPServasync def test_mcp_tool_parameter_validation(test_mcp_server_script):"""Test that MCP tool parameters are properly validated."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -391,7 +391,7 @@ async def test_mcp_tool_parameter_validation(test_mcp_server_script):async def test_mcp_client_prefix_and_filtering(test_mcp_server_script):"""Test tool filtering and prefixing."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -420,7 +420,7 @@ async def test_mcp_client_prefix_and_filtering(test_mcp_server_script):async def test_mcp_tool_error_handling(test_mcp_server_script):"""Test error handling in MCP tools."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -446,7 +446,7 @@ async def test_mcp_tool_error_handling(test_mcp_server_script):async def test_mcp_client_context_manager(test_mcp_server_script):"""Test using MCP client as context manager."""- controller = Controller()+ controller = Tools()# Use as context managerasync with MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script]) as mcp_client:@@ -468,7 +468,7 @@ async def test_mcp_client_context_manager(test_mcp_server_script):async def test_multiple_mcp_servers(test_mcp_server_script):"""Test connecting multiple MCP servers to the same controller."""- controller = Controller()+ controller = Tools()# First MCP server with prefixmcp1 = MCPClient(server_name='server1', command=sys.executable, args=[test_mcp_server_script])@@ -512,7 +512,7 @@ async def test_multiple_mcp_servers(test_mcp_server_script):async def test_mcp_result_formatting(test_mcp_server_script):"""Test that different MCP result formats are handled correctly."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -550,7 +550,7 @@ async def test_agent_with_multiple_mcp_servers(test_mcp_server_script, httpservebrowser_session = BrowserSession(browser_profile=BrowserProfile(headless=True, user_data_dir=None))await browser_session.start()- controller = Controller()+ controller = Tools()# Connect two MCP servers with different prefixesmcp_server1 = MCPClient(server_name='math-server', command=sys.executable, args=[test_mcp_server_script])@@ -635,7 +635,7 @@ Use tools from both servers to complete the task.""",async def test_mcp_nested_object_parameters(test_mcp_server_script):"""Test that MCP tools with nested object parameters are properly handled."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])@@ -727,7 +727,7 @@ async def test_mcp_nested_object_parameters(test_mcp_server_script):async def test_mcp_array_type_inference(test_mcp_server_script):"""Test that MCP tools with array parameters have proper type inference."""- controller = Controller()+ controller = Tools()mcp_client = MCPClient(server_name='test-server', command=sys.executable, args=[test_mcp_server_script])diff --git a/tests/ci/test_registry_action_search_google.py b/tests/ci/test_registry_action_search_google.pyindex a9ca40d87..9fc2a002b 100644--- a/tests/ci/test_registry_action_search_google.py+++ b/tests/ci/test_registry_action_search_google.py@@ -6,7 +6,7 @@ import pytestfrom browser_use.browser import BrowserSessionfrom browser_use.browser.events import BrowserStateRequestEvent, NavigateToUrlEvent-from browser_use.controller.service import Controller+from browser_use.controller.service import Tools@pytest.fixture@@ -21,7 +21,7 @@ async def browser_session():async def test_search_google_creates_and_focuses_new_tab(browser_session: BrowserSession):"""Test that search_google creates a new tab and properly switches focus to it."""# Create controller to get the search_google action- controller = Controller()+ controller = Tools()# Get initial browser stateinitial_state_event = browser_session.event_bus.dispatch(BrowserStateRequestEvent(include_screenshot=False))