Skip to content

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

Expose real_v8 smoke step timeout

Magnus Müller5d0a9529a373
diff --git a/RUST_AGENT_INTEGRATION_FEATURES.md b/RUST_AGENT_INTEGRATION_FEATURES.md
index 863a17d1c..17b7439c0 100644
--- a/RUST_AGENT_INTEGRATION_FEATURES.md
+++ b/RUST_AGENT_INTEGRATION_FEATURES.md
@@ -795,10 +795,15 @@ Terminal core branch: `magnus/browser-use-rust-main-integration` at terminal mai
- This preserves current-main child-agent failure payloads that store error text under nested `payload.failure`, plus sensible cancellation/failure fallbacks when no text is present.
- Proof: `test_rust_history_surfaces_terminal_subagent_failure_events`.
+157. real_v8 smoke step-timeout bridge
+ - `examples/rust_agent/real_v8_smoke.py` now accepts `--step-timeout` and `BU_STEP_TIMEOUT`, then passes the value to the Rust-backed Browser Use `Agent(step_timeout=...)`.
+ - This keeps benchmark cloud smokes on the public Browser Use timeout interface instead of requiring task-specific runner edits when real_v8 tasks exceed the 120-second default.
+ - Proof: `test_real_v8_smoke_passes_step_timeout_to_agent`.
+
## 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` (128 tests)
+- `uv run pytest -q tests/ci/test_rust_agent.py` (129 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`
@@ -861,6 +866,10 @@ Terminal core branch: `magnus/browser-use-rust-main-integration` at terminal mai
- Source `/home/exedev/.evaluation_tool_env`.
- `BROWSER_USE_TERMINAL_BINARY=/home/exedev/Developer/terminal/target/debug/browser-use-terminal BROWSER_USE_RUST_BROWSER_MODE=cloud BU_TASK='Open https://example.com and report the page title only.' BU_MAX_STEPS=12 timeout 300 uv run python examples/rust_agent/basic.py`
- Output: `Example Domain`
+- real_v8 cloud-browser end-to-end:
+ - Source `/home/exedev/.evaluation_tool_env`.
+ - `REAL_V8_DATASET=/home/exedev/Developer/evaluations-internal/datasets/real_v8.json BROWSER_USE_TERMINAL_BINARY=/home/exedev/Developer/terminal/target/debug/browser-use-terminal BROWSER_USE_RUST_BROWSER_MODE=cloud timeout 900 uv run python examples/rust_agent/real_v8_smoke.py --task-id 18 --max-steps 30 --step-timeout 600`
+ - Output: `{"task_id": "18", "successful": true, "final_result": "Paramjit Uppal, Founder"}`
- Existing-session follow-up end-to-end:
- `BROWSER_USE_TERMINAL_BINARY=/home/exedev/Developer/terminal/target/debug/browser-use-terminal BROWSER_USE_RUST_BROWSER_MODE=managed-headless BROWSER_USE_RUST_STATE_DIR=/tmp/browser-use-rust-followup-smoke timeout 420 uv run python - <<'PY' ...`
- Output: first run `Example Domain`; follow-up `example.com`.
@@ -871,4 +880,4 @@ Terminal core branch: `magnus/browser-use-rust-main-integration` at terminal mai
## Not Verified Yet
-- Full real_v8 cloud-browser verification is intentionally not the active focus now. Per latest direction, benchmark runs should remain final smoke evidence only and should not drive task-specific changes.
+- A broader multi-task real_v8 cloud-browser sweep is not complete yet. The current proof covers one live benchmark task through Browser Use cloud and the Python Rust-backed Agent interface.
diff --git a/examples/rust_agent/real_v8_smoke.py b/examples/rust_agent/real_v8_smoke.py
index 10e7d8ca3..94a477d4b 100644
--- a/examples/rust_agent/real_v8_smoke.py
+++ b/examples/rust_agent/real_v8_smoke.py
@@ -81,6 +81,12 @@ def parse_args() -> argparse.Namespace:
default=_int_from_env('BU_MAX_STEPS', 40),
help='Maximum Rust terminal agent turns.',
)
+ parser.add_argument(
+ '--step-timeout',
+ type=int,
+ default=_int_from_env('BU_STEP_TIMEOUT', 120),
+ help='Maximum seconds to wait for the Rust terminal subprocess.',
+ )
parser.add_argument(
'--cdp-url',
default=os.environ.get('BU_CDP_URL') or os.environ.get('BROWSER_USE_CDP_URL'),
@@ -100,7 +106,12 @@ async def run_smoke(args: argparse.Namespace) -> None:
case = select_case(cases, index=args.index, task_id=args.task_id)
browser_session = BrowserSession(cdp_url=args.cdp_url) if args.cdp_url else None
- agent = Agent(task=case['confirmed_task'], browser_session=browser_session, task_id=case['task_id'])
+ agent = Agent(
+ task=case['confirmed_task'],
+ browser_session=browser_session,
+ task_id=case['task_id'],
+ step_timeout=args.step_timeout,
+ )
history = await agent.run(max_steps=args.max_steps)
final_result = history.final_result()
print(json.dumps(_summary(case, final_result, history.is_successful(), agent), indent=2))
diff --git a/tests/ci/test_rust_agent.py b/tests/ci/test_rust_agent.py
index 45cd2840a..ed7fe3c46 100644
--- a/tests/ci/test_rust_agent.py
+++ b/tests/ci/test_rust_agent.py
@@ -4300,3 +4300,58 @@ def test_real_v8_smoke_selects_case_by_index_and_task_id(tmp_path):
assert module.select_case(cases, index=None, task_id='1')['confirmed_task'] == 'first task'
with pytest.raises(ValueError, match='Select by index or task_id'):
module.select_case(cases, index=0, task_id='1')
+
+
+async def test_real_v8_smoke_passes_step_timeout_to_agent(tmp_path, monkeypatch, capsys):
+ module = _load_real_v8_smoke_module()
+ dataset = tmp_path / 'real_v8.json'
+ dataset.write_text(json.dumps([{'task_id': '18', 'confirmed_task': 'find leadership'}]), encoding='utf-8')
+ seen: dict[str, object] = {}
+
+ class FakeHistory:
+ def final_result(self):
+ return 'done'
+
+ def is_successful(self):
+ return True
+
+ def errors(self):
+ return []
+
+ def urls(self):
+ return ['https://example.com']
+
+ class FakeAgent:
+ session_id = 'session-1'
+
+ def __init__(self, **kwargs):
+ seen.update(kwargs)
+ self.history = FakeHistory()
+
+ async def run(self, max_steps):
+ seen['max_steps'] = max_steps
+ return self.history
+
+ monkeypatch.setattr(module, 'Agent', FakeAgent)
+
+ await module.run_smoke(
+ type(
+ 'Args',
+ (),
+ {
+ 'dataset': dataset,
+ 'list': False,
+ 'index': None,
+ 'task_id': '18',
+ 'max_steps': 7,
+ 'step_timeout': 600,
+ 'cdp_url': None,
+ },
+ )()
+ )
+
+ assert seen['task'] == 'find leadership'
+ assert seen['task_id'] == '18'
+ assert seen['step_timeout'] == 600
+ assert seen['max_steps'] == 7
+ assert json.loads(capsys.readouterr().out)['final_result'] == 'done'