Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Use browser-use-core Rust package

Gregor Žuničb056911139a0
diff --git a/browser_use/rust/service.py b/browser_use/rust/service.py
index 2ed3dbaa6..e176c9ce3 100644
--- a/browser_use/rust/service.py
+++ b/browser_use/rust/service.py
@@ -205,13 +205,13 @@ def find_browser_use_terminal_binary() -> str:
return path_binary
raise RustAgentError(
f'Could not find browser-use-terminal. Install Browser Use Terminal with `{TERMINAL_INSTALL_COMMAND}`, '
- 'install browser-use-rust, or set BROWSER_USE_TERMINAL_BINARY to a built terminal CLI.'
+ 'install browser-use-core, or set BROWSER_USE_TERMINAL_BINARY to a built terminal CLI.'
)
def _find_packaged_browser_use_terminal_binary() -> str | None:
try:
- from browser_use_rust import binary_path
+ from browser_use_core import binary_path
except Exception:
return None
try:
@@ -6267,7 +6267,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):
self._sdk_client = None
raise RustAgentError(
f'Unsupported browser-use-terminal SDK protocol {protocol_version!r}; expected 1. '
- 'Install a compatible browser-use-rust package or set BROWSER_USE_TERMINAL_BINARY to a compatible binary.'
+ 'Install a compatible browser-use-core package or set BROWSER_USE_TERMINAL_BINARY to a compatible binary.'
)
return self._sdk_client
diff --git a/pyproject.toml b/pyproject.toml
index 4a98c5ae0..e3694ef79 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -59,7 +59,7 @@ dependencies = [
[project.optional-dependencies]
cli = ["textual==7.4.0"]
-rust = ["browser-use-rust==0.13.0"]
+rust = ["browser-use-core==0.13.0"]
aws = ["boto3==1.42.37"]
oci = ["oci==2.166.0"]
video = ["imageio[ffmpeg]==2.37.2", "numpy==2.4.1"]
diff --git a/tests/ci/test_rust_agent.py b/tests/ci/test_rust_agent.py
index 89ebb67bd..fa5aba738 100644
--- a/tests/ci/test_rust_agent.py
+++ b/tests/ci/test_rust_agent.py
@@ -2620,7 +2620,7 @@ def test_rust_terminal_binary_missing_error_mentions_install(monkeypatch):
import browser_use.rust.service as rust_service
monkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)
- monkeypatch.setitem(sys.modules, 'browser_use_rust', None)
+ monkeypatch.setitem(sys.modules, 'browser_use_core', None)
monkeypatch.setattr(rust_service.Path, 'exists', lambda self: False)
monkeypatch.setattr(rust_service.shutil, 'which', lambda binary: None)
@@ -2629,21 +2629,21 @@ def test_rust_terminal_binary_missing_error_mentions_install(monkeypatch):
message = str(exc_info.value)
assert 'https://browser-use.com/terminal/install.sh' in message
- assert 'browser-use-rust' in message
+ assert 'browser-use-core' in message
assert 'BROWSER_USE_TERMINAL_BINARY' in message
def test_rust_terminal_binary_prefers_packaged_binary(monkeypatch):
import browser_use.rust.service as rust_service
- class PackagedRust:
+ class PackagedCore:
@staticmethod
def binary_path(binary_name):
assert binary_name == 'browser-use-terminal'
return '/tmp/packaged-browser-use-terminal'
monkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)
- monkeypatch.setitem(sys.modules, 'browser_use_rust', PackagedRust)
+ monkeypatch.setitem(sys.modules, 'browser_use_core', PackagedCore)
monkeypatch.setattr(rust_service.Path, 'exists', lambda self: False)
monkeypatch.setattr(rust_service.shutil, 'which', lambda binary_name: None)
@@ -2658,7 +2658,7 @@ def test_rust_terminal_binary_finds_default_terminal_install(monkeypatch, tmp_pa
binary.write_text('#!/bin/sh\n')
monkeypatch.delenv('BROWSER_USE_TERMINAL_BINARY', raising=False)
- monkeypatch.setitem(sys.modules, 'browser_use_rust', None)
+ monkeypatch.setitem(sys.modules, 'browser_use_core', None)
monkeypatch.chdir(tmp_path)
monkeypatch.setenv('BUT_HOME', str(tmp_path / '.browser-use-terminal'))
monkeypatch.setenv('BUT_INSTALL_DIR', str(tmp_path / '.local' / 'bin'))