Skip to content

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

fix review issues from cubic bot

ShawnPana8dfb3cc8827a
diff --git a/skills/browser-use-docs/SKILL.md b/skills/browser-use-docs/SKILL.md
index 52956e90d..b8b7a27d6 100644
--- a/skills/browser-use-docs/SKILL.md
+++ b/skills/browser-use-docs/SKILL.md
@@ -52,7 +52,7 @@ Read the relevant reference file based on what the user needs.
- `Browser` is an alias for `BrowserSession` — same class
- Use `uv` for dependency management, never `pip`
- Install: `uv pip install browser-use` then `uvx browser-use install`
-- Cloud SDK: `pip install browser-use-sdk`
+- Cloud SDK: `uv pip install browser-use-sdk`
- Cloud API base URL: `https://api.browser-use.com/api/v2/`
- Cloud API auth: `X-Browser-Use-API-Key: <key>` header
- Get API key: https://cloud.browser-use.com/new-api-key
diff --git a/skills/browser-use-docs/references/cloud/api-v2.md b/skills/browser-use-docs/references/cloud/api-v2.md
index 107cd367e..9c50c235d 100644
--- a/skills/browser-use-docs/references/cloud/api-v2.md
+++ b/skills/browser-use-docs/references/cloud/api-v2.md
@@ -85,13 +85,14 @@ curl -X POST https://api.browser-use.com/api/v2/files/sessions/<session-id>/pres
-H "Content-Type: application/json" \
-d '{"fileName": "input.pdf", "contentType": "application/pdf", "sizeBytes": 102400}'
-# 2. Upload via PUT to the returned URL
-curl -X PUT "<presigned-url>" \
- -H "Content-Type: application/pdf" \
- --data-binary @input.pdf
+# 2. Upload via multipart POST using the returned URL and fields (S3-style presigned POST)
+curl -X POST "<presigned-url>" \
+ -F "key=<fields.key>" \
+ -F "Content-Type=application/pdf" \
```
-Presigned URLs expire after **120 seconds**. Max file size: **10 MB**.
+The v2 presigned URL response includes `fields` for a multipart POST form upload (S3-style). Presigned URLs expire after **120 seconds**. Max file size: **10 MB**.
---
@@ -208,7 +209,7 @@ Errors: 400 (unsupported type), 404, 500.
Response: `{ id: uuid, fileName: string, downloadUrl: string }`
Errors: 404, 500.
-**Upload flow:** Get presigned URL → PUT file with Content-Type header → URL expires in 120s → Max 10 MB.
+**Upload flow:** Get presigned URL → POST multipart form with returned `fields` + file → URL expires in 120s → Max 10 MB.
---
diff --git a/skills/browser-use-docs/references/cloud/features.md b/skills/browser-use-docs/references/cloud/features.md
index 8a6a5bdd3..729df6ae8 100644
--- a/skills/browser-use-docs/references/cloud/features.md
+++ b/skills/browser-use-docs/references/cloud/features.md
@@ -100,15 +100,18 @@ client = AsyncBrowserUse()
# Create workspace
workspace = await client.workspaces.create(name="my-data")
+# Create a session
+session = await client.sessions.create()
+
# Upload files before task
await client.sessions.upload_files(
- session_id,
+ session.id,
workspace_id=workspace.id,
files=[open("input.pdf", "rb")]
)
# Download files after task
-files = await client.sessions.files(session_id)
+files = await client.sessions.files(session.id)
for f in files:
url = f.download_url # Presigned URL (60s expiry)
diff --git a/skills/browser-use-docs/references/open-source/agent.md b/skills/browser-use-docs/references/open-source/agent.md
index 8b101baf9..ff76a453e 100644
--- a/skills/browser-use-docs/references/open-source/agent.md
+++ b/skills/browser-use-docs/references/open-source/agent.md
@@ -38,7 +38,7 @@ async def main():
- `output_model_schema`: Pydantic model class for structured output validation
### Vision & Processing
-- `use_vision` (default: `"auto"`): `"auto"` includes screenshot tool but only uses vision when requested, `True` always includes screenshots, `False` never
+- `use_vision` (default: `True`): `True` always includes screenshots, `"auto"` includes screenshot tool but only uses vision when requested, `False` never
- `vision_detail_level` (default: `'auto'`): `'low'`, `'high'`, or `'auto'`
- `page_extraction_llm`: Separate LLM for page content extraction (default: same as `llm`)
@@ -47,8 +47,8 @@ async def main():
### Actions & Behavior
- `initial_actions`: Actions to run before main task without LLM
-- `max_actions_per_step` (default: `4`): Max actions per step (e.g., fill 4 form fields at once)
-- `max_failures` (default: `3`): Max retries for steps with errors
+- `max_actions_per_step` (default: `5`): Max actions per step (e.g., fill 5 form fields at once)
+- `max_failures` (default: `5`): Max retries for steps with errors
- `final_response_after_failure` (default: `True`): Force one final model call after max_failures
- `use_thinking` (default: `True`): Enable explicit reasoning steps
- `flash_mode` (default: `False`): Fast mode — skips evaluation, next goal, thinking; uses memory only. Overrides `use_thinking`
@@ -69,8 +69,8 @@ async def main():
### Performance & Limits
- `max_history_items`: Max steps to keep in LLM memory (`None` = all)
-- `llm_timeout` (default: `90`): Seconds for LLM calls
-- `step_timeout` (default: `120`): Seconds for each step
+- `llm_timeout` (default: `60`, auto-detected: 30s for Gemini, 90s for o3): Seconds for LLM calls
+- `step_timeout` (default: `180`): Seconds for each step
- `directly_open_url` (default: `True`): Auto-open URLs detected in task
### Advanced
diff --git a/skills/browser-use-docs/references/open-source/examples.md b/skills/browser-use-docs/references/open-source/examples.md
index 748294934..7123ceb3b 100644
--- a/skills/browser-use-docs/references/open-source/examples.md
+++ b/skills/browser-use-docs/references/open-source/examples.md
@@ -52,10 +52,12 @@ from browser_use import Agent, Browser, ChatBrowserUse
async def run_task(task: str, index: int):
browser = Browser(user_data_dir=f'./temp-profile-{index}')
- agent = Agent(task=task, llm=ChatBrowserUse(), browser=browser)
- result = await agent.run()
- await browser.close()
- return result
+ try:
+ agent = Agent(task=task, llm=ChatBrowserUse(), browser=browser)
+ result = await agent.run()
+ return result
+ finally:
+ await browser.close()
async def main():
tasks = [
@@ -145,30 +147,35 @@ proc = subprocess.Popen([
'google-chrome', '--remote-debugging-port=9222', '--user-data-dir=/tmp/chrome-debug'
])
-# 2. Connect Playwright
-pw = await async_playwright().start()
-pw_browser = await pw.chromium.connect_over_cdp("http://localhost:9222")
-pw_page = pw_browser.contexts[0].pages[0]
-
-# 3. Connect Browser-Use to same Chrome
-browser = Browser(cdp_url="http://localhost:9222")
-
-# 4. Custom tools using Playwright
-tools = Tools()
-
[email protected](description='Fill form field using Playwright selector')
-async def pw_fill(selector: str, value: str) -> str:
- await pw_page.fill(selector, value)
- return f'Filled {selector}'
-
[email protected](description='Take Playwright screenshot')
-async def pw_screenshot() -> str:
- await pw_page.screenshot(path='screenshot.png')
- return 'Screenshot saved'
-
-# 5. Agent orchestrates using both
-agent = Agent(task="Fill out the form", llm=ChatBrowserUse(), browser=browser, tools=tools)
-await agent.run()
+try:
+ # 2. Connect Playwright
+ pw = await async_playwright().start()
+ pw_browser = await pw.chromium.connect_over_cdp("http://localhost:9222")
+ pw_page = pw_browser.contexts[0].pages[0]
+
+ # 3. Connect Browser-Use to same Chrome
+ browser = Browser(cdp_url="http://localhost:9222")
+
+ # 4. Custom tools using Playwright
+ tools = Tools()
+
+ @tools.action(description='Fill form field using Playwright selector')
+ async def pw_fill(selector: str, value: str) -> str:
+ await pw_page.fill(selector, value)
+ return f'Filled {selector}'
+
+ @tools.action(description='Take Playwright screenshot')
+ async def pw_screenshot() -> str:
+ await pw_page.screenshot(path='screenshot.png')
+ return 'Screenshot saved'
+
+ # 5. Agent orchestrates using both
+ agent = Agent(task="Fill out the form", llm=ChatBrowserUse(), browser=browser, tools=tools)
+ await agent.run()
+finally:
+ await pw.stop()
+ proc.terminate()
+ proc.wait()
```
Both Playwright and Browser-Use operate on the same pages through the shared CDP connection.
diff --git a/skills/browser-use-docs/references/open-source/integrations.md b/skills/browser-use-docs/references/open-source/integrations.md
index 4f5491b47..4bb789238 100644
--- a/skills/browser-use-docs/references/open-source/integrations.md
+++ b/skills/browser-use-docs/references/open-source/integrations.md
@@ -173,7 +173,7 @@ Read-only docs access (no browser automation):
**Claude Code:**
```bash
-claude mcp add --transport http browser-use https://docs.browser-use.com/mcp
+claude mcp add --transport http browser-use-docs https://docs.browser-use.com/mcp
```
**Cursor** (`~/.cursor/mcp.json`):
diff --git a/skills/browser-use-docs/references/open-source/models.md b/skills/browser-use-docs/references/open-source/models.md
index 67cc2682c..57d313dde 100644
--- a/skills/browser-use-docs/references/open-source/models.md
+++ b/skills/browser-use-docs/references/open-source/models.md
@@ -135,12 +135,16 @@ Proxy to multiple providers with automatic fallback:
```python
from browser_use import ChatVercel
llm = ChatVercel(
- model='anthropic:claude-sonnet-4-20250514',
- provider='order: ["vertex", "anthropic"]', # Fallback order
+ model='anthropic/claude-sonnet-4',
+ provider_options={
+ 'gateway': {
+ 'order': ['vertex', 'anthropic'], # Fallback order
+ }
+ },
)
```
-**Env:** `VERCEL_API_KEY`
+**Env:** `AI_GATEWAY_API_KEY` (or `VERCEL_OIDC_TOKEN` on Vercel)
## OpenAI-Compatible APIs
diff --git a/skills/browser-use-docs/references/open-source/monitoring.md b/skills/browser-use-docs/references/open-source/monitoring.md
index b6392e6fb..46ab5be2d 100644
--- a/skills/browser-use-docs/references/open-source/monitoring.md
+++ b/skills/browser-use-docs/references/open-source/monitoring.md
@@ -17,7 +17,7 @@ history = await agent.run()
# Access usage data
usage = history.usage
# Or via service
-summary = agent.token_cost_service.get_usage_summary()
+summary = await agent.token_cost_service.get_usage_summary()
```
## Laminar