Skip to content
Open
26 changes: 16 additions & 10 deletions crates/browser-use-agent/src/entrypoint/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,9 +1139,9 @@ fn resolve_provider_with_python(
/// The registry registers the backend-free handlers — `shell`, `apply_patch`,
/// `view_image`, `update_plan`, `done`, `tool_search` (catalog populated from the registered tools' defs),
/// `web_search` (ENABLED; the Responses builder encodes it as the hosted
/// `web_search_preview` tool), `search` (a locally-executed DuckDuckGo search,
/// distinct from the hosted `web_search`) — plus the two product-surface tools
/// that drive real subsystems:
/// `web_search_preview` tool), `search` (a client-executed call to the
/// browser-use search API, distinct from the hosted `web_search`) — plus the
/// two product-surface tools that drive real subsystems:
/// * `browser` ([`BrowserTool::new`]): standalone — the production
/// [`RealBackend`](crate::tools::handlers::browser::RealBackend) wraps the
/// `browser-use-browser` crate and manages CDP sessions internally (keyed by
Expand Down Expand Up @@ -1237,7 +1237,7 @@ fn build_tool_dispatcher_with_cwd_and_goal_store(
use crate::tools::handlers::done::{DoneRequest, DoneTool};
use crate::tools::handlers::mcp::McpToolCallRequest;
use crate::tools::handlers::python::{PythonRequest, PythonTool};
use crate::tools::handlers::search::{SearchRequest, SearchTool};
use crate::tools::handlers::search::{SearchRequest, SearchTool, SEARCH_PARALLEL_SAFE};
use crate::tools::handlers::shell::{
ExecCommandRequest, ExecCommandTool, ShellRequest, ShellTool, WriteStdinRequest,
WriteStdinTool,
Expand Down Expand Up @@ -1322,10 +1322,16 @@ fn build_tool_dispatcher_with_cwd_and_goal_store(
true,
WebSearchTool::new(WebSearchConfig::enabled()),
);
// `search`: locally-executed DuckDuckGo (Lite) web search — the client runs
// the HTTP request and parses the results itself (distinct from the hosted
// `web_search` above). Read-only, so parallel_safe = true.
reg.register::<_, SearchRequest>("search", definitions::search(), true, SearchTool::new());
// `search`: web search via the browser-use search API — the client makes
// the API call (auth: `BROWSER_USE_API_KEY`) and formats the results itself
// (distinct from the hosted `web_search` above). Serial: a conservative
// scheduling default for a billed API call.
reg.register::<_, SearchRequest>(
"search",
definitions::search(),
SEARCH_PARALLEL_SAFE,
SearchTool::new(),
);
let browser_backend = browser_backend_for_runtime_or_config(
config,
runtime_handle.as_ref(),
Expand Down Expand Up @@ -3281,11 +3287,11 @@ mod tests {
assert!(names.contains(&"done"));
assert!(names.contains(&"update_plan"));
// Both web searches are wired into the production dispatcher: the hosted
// `web_search` and the locally-executed DuckDuckGo `search`.
// `web_search` and the browser-use search API `search`.
assert!(names.contains(&"web_search"));
assert!(
names.contains(&"search"),
"the locally-executed `search` tool must be reachable by the live model"
"the `search` tool must be reachable by the live model"
);
}

Expand Down
5 changes: 2 additions & 3 deletions crates/browser-use-agent/src/tools/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ pub use mcp::{
};
pub use python::{PythonApprovalKey, PythonBackend, PythonRequest, PythonTool};
pub use search::{
classify_response, extract_real_url, format_results, normalize_whitespace, parse_lite_results,
HttpSearchBackend, SearchApprovalKey, SearchBackend, SearchError, SearchRequest, SearchResult,
SearchTool,
classify_response, format_results, normalize_whitespace, parse_results, HttpSearchBackend,
SearchApprovalKey, SearchBackend, SearchError, SearchRequest, SearchResult, SearchTool,
};
pub use shell::{
ExecCommandApprovalKey, ExecCommandRequest, ExecCommandTool, ShellApprovalKey, ShellRequest,
Expand Down
Loading
Loading