Skip to content

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

Match Rust agent doc metadata

Magnus Müllerdb4f86800f28
diff --git a/RUST_AGENT_INTEGRATION_FEATURES.md b/RUST_AGENT_INTEGRATION_FEATURES.md
index b44a42947..c972625e3 100644
--- a/RUST_AGENT_INTEGRATION_FEATURES.md
+++ b/RUST_AGENT_INTEGRATION_FEATURES.md
@@ -624,6 +624,11 @@ Terminal core branch: `magnus/browser-use-rust-main-integration` at terminal mai
- This makes `AgentHistoryList.urls()` reflect pages visited by the Rust terminal core instead of returning an empty URL when terminal main emits browser state through script output summaries.
- Proof: `test_rust_history_reconstructs_terminal_browser_script_urls`.
+123. Rust Agent class doc metadata parity
+ - The Rust-backed replacement now mirrors Browser Use's original `Agent.__doc__` metadata.
+ - This keeps docs, runtime introspection, and service-export class metadata aligned after `browser_use.agent.service.Agent` redirects to the Rust wrapper.
+ - Proof: `test_rust_agent_class_metadata_matches_browser_use_service_surface`.
+
## 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`
diff --git a/browser_use/rust/service.py b/browser_use/rust/service.py
index 8951210cc..2db3a4f5f 100644
--- a/browser_use/rust/service.py
+++ b/browser_use/rust/service.py
@@ -2750,3 +2750,4 @@ class Agent(Generic[Context, AgentStructuredOutput]):
Agent.__module__ = 'browser_use.agent.service'
+Agent.__doc__ = None
diff --git a/tests/ci/test_rust_agent.py b/tests/ci/test_rust_agent.py
index 3891ac392..c4cb76ec3 100644
--- a/tests/ci/test_rust_agent.py
+++ b/tests/ci/test_rust_agent.py
@@ -52,6 +52,7 @@ def test_rust_agent_class_metadata_matches_browser_use_service_surface():
assert RustAgent.__name__ == BrowserUseAgent.__name__ == 'Agent'
assert RustAgent.__qualname__ == BrowserUseAgent.__qualname__ == 'Agent'
assert RustAgent.__module__ == BrowserUseAgent.__module__ == 'browser_use.agent.service'
+ assert RustAgent.__doc__ == BrowserUseAgent.__doc__
assert repr(RustAgent) == repr(BrowserUseAgent)