Skip to content

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

Match Rust cloud sync warning

Magnus Müller2e0482f94c86
diff --git a/RUST_AGENT_INTEGRATION_FEATURES.md b/RUST_AGENT_INTEGRATION_FEATURES.md
index 433137c7d..081360472 100644
--- a/RUST_AGENT_INTEGRATION_FEATURES.md
+++ b/RUST_AGENT_INTEGRATION_FEATURES.md
@@ -1101,10 +1101,15 @@ Terminal core branch: `magnus/browser-use-rust-main-integration` at terminal mai
- This asks terminal current-main OpenAI-compatible providers to include token usage in responses so Browser Use-style usage/cost reconstruction has data to report.
- Proof: `test_rust_agent_requests_openai_compatible_usage_for_cost_calculation`.
+218. Rust Agent cloud-sync warning parity
+ - Rust-backed `authenticate_cloud_sync()` now logs Browser Use's cloud-sync removal warning before returning `False`.
+ - This preserves the user-visible helper behavior for callers that still probe the deprecated cloud-sync API.
+ - Proof: `test_rust_agent_authenticate_cloud_sync_logs_browser_use_warning`.
+
## Current Verification
- `python3 -m py_compile browser_use/agent/service.py browser_use/rust/service.py browser_use/rust/__init__.py browser_use/__init__.py tests/ci/test_rust_agent.py examples/rust_agent/basic.py examples/rust_agent/real_v8_smoke.py`
-- `uv run pytest -q tests/ci/test_rust_agent.py` (185 tests)
+- `uv run pytest -q tests/ci/test_rust_agent.py` (186 tests)
- `cargo build -q -p browser-use-cli` on terminal branch `magnus/browser-use-rust-main-integration`
- `cargo test -q -p browser-use-cli run_codex_session_command_accepts_task_id_and_model -- --nocapture`
- `CARGO_INCREMENTAL=0 cargo test -q -p browser-use-agent selected_remote_cdp_mode_allows_remote_cdp_connect -- --nocapture`
diff --git a/browser_use/rust/service.py b/browser_use/rust/service.py
index 89fea20a2..491b81190 100644
--- a/browser_use/rust/service.py
+++ b/browser_use/rust/service.py
@@ -4053,6 +4053,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):
The Rust wrapper mirrors that contract.
"""
_ = show_instructions
+ self.logger.warning('Cloud sync has been removed and is no longer available')
return False
def get_trace_object(self) -> dict[str, Any]:
diff --git a/tests/ci/test_rust_agent.py b/tests/ci/test_rust_agent.py
index 2a419f809..85ef2fc60 100644
--- a/tests/ci/test_rust_agent.py
+++ b/tests/ci/test_rust_agent.py
@@ -6856,6 +6856,47 @@ async def test_rust_agent_trace_and_cloud_auth_helpers():
assert 'trace answer' in trace_object['trace_details']['complete_history']
+async def test_rust_agent_authenticate_cloud_sync_logs_browser_use_warning(monkeypatch):
+ from browser_use.agent.service import _PythonAgent as BrowserUseAgent
+ from browser_use.rust import Agent as RustAgent
+
+ class LLM:
+ model = 'gpt-test'
+ provider = 'test'
+
+ async def ainvoke(self, messages, output_format=None, **kwargs):
+ return type('Result', (), {'usage': None})()
+
+ class RecordingLogger:
+ def __init__(self):
+ self.warnings = []
+
+ def debug(self, message, *args, **kwargs):
+ pass
+
+ def info(self, message, *args, **kwargs):
+ pass
+
+ def warning(self, message, *args, **kwargs):
+ self.warnings.append(message)
+
+ def error(self, message, *args, **kwargs):
+ pass
+
+ browser_use_logger = RecordingLogger()
+ rust_logger = RecordingLogger()
+ monkeypatch.setattr(BrowserUseAgent, 'logger', property(lambda self: browser_use_logger))
+ monkeypatch.setattr(RustAgent, 'logger', property(lambda self: rust_logger))
+
+ browser_use_agent = BrowserUseAgent(task='Cloud sync warning parity.', llm=LLM(), directly_open_url=False)
+ rust_agent = RustAgent(task='Cloud sync warning parity.', llm=LLM(), directly_open_url=False)
+
+ assert await browser_use_agent.authenticate_cloud_sync(show_instructions=False) is False
+ assert await rust_agent.authenticate_cloud_sync(show_instructions=False) is False
+ assert rust_logger.warnings == browser_use_logger.warnings
+ assert rust_logger.warnings == ['Cloud sync has been removed and is no longer available']
+
+
def test_rust_agent_trace_metadata_matches_browser_use_helpers(monkeypatch):
from browser_use.rust import Agent
import browser_use.rust.service as rust_service