Commit Graph

8765 Commits

Author SHA1 Message Date
Saurav Panda
73d64d7bb5 remove read long content action 2026-03-12 12:44:10 -07:00
Saurav Panda
83c9d63842 fix: add strict data grounding rules to prevent hallucination (#4323)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Add strict data grounding rules across all agent prompts to block
fabricated data and reduce hallucinations. Prompts now only report
values seen in tool outputs or browser state, and must say “not found”
when data isn’t extracted.

- **Bug Fixes**
- Added DATA GROUNDING to core, Anthropic/Flash, and no-thinking
prompts, plus output blocks; forbids fabricated URLs, prices, values
(including “representative” ones).
- Replaced pre-done verification with a grounding check: every
URL/price/name/value must appear verbatim in tool outputs or
browser_state; never construct URLs; if missing, say “not found”.
- Added a critical reminder across prompts: never fabricate URLs, image
links, prices, or any data; prefer partial results with `success=false`
when uncertain.
- Inserted a grounding note into all `system_prompt_browser_use*` and
`system_prompt_flash*` output sections.

<sup>Written for commit 347904198c.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-10 20:15:55 -07:00
Saurav Panda
347904198c Merge branch 'main' into fix-hallucination-ssies 2026-03-10 18:57:29 -07:00
Saurav Panda
032ee15c19 fix: add strict data grounding rules to prevent hallucination 2026-03-10 18:51:13 -07:00
Saurav Panda
bf2e727dd1 Remove free credit mentions from documentation (#4322)
## Summary
Updated documentation to remove references to free credits and
promotional offers, simplifying the API key setup instructions across
multiple documentation files.

## Key Changes
- Removed "$10 free credits" mention from the ChatBrowserUse
recommendation in AGENTS.md
- Simplified the API key acquisition language from "Don't have one? We
give you **$10** to try it out" to "Get your API key"
- Updated the .env file comment from "Get 10$ of free credits" to "Get
your API key"
- Removed the free credits reference from the README.md quick start
section

## Details
These changes streamline the documentation by removing time-sensitive
promotional information, making the setup instructions more evergreen
and focused on the core functionality rather than temporary offers. The
links to the API key generation page remain unchanged.

https://claude.ai/code/session_01CTCYfXrPi3SxEZeBy9DevS

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Removed all $10 signup credit mentions from `AGENTS.md` and `README.md`
and simplified API key setup wording. Updated `ChatBrowserUse` callouts
and `.env` comments to link to the API key page without promotions.

<sup>Written for commit eb17dac289.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-10 18:21:45 -07:00
Saurav Panda
eb17dac289 Merge branch 'main' into claude/slack-remove-gmail-oauth-credits-7loEQ 2026-03-10 17:16:23 -07:00
Saurav Panda
52f954a4b3 fix: prevent duplicate items in multi-page extraction via already_col… (#4320)
…lected parameter

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Prevents duplicate items when extracting across multiple pages by adding
an optional `already_collected` parameter to `extract()` and updating
prompts to use it. This keeps paginated results clean and avoids
repeated work.

- **Bug Fixes**
- Added optional `already_collected` to `ExtractAction` and plumbed it
through `service.extract()`; the extractor skips items whose
name/title/URL match provided identifiers.
- Updated system prompts to save item identifiers after each page and
pass them via `already_collected`; dedupe before completion.
- Backwards compatible: defaults to an empty list; existing calls work
unchanged.

<sup>Written for commit ce25884751.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-10 16:43:31 -07:00
Saurav Panda
990e0ce828 Merge branch 'main' into fix-duplicate-extraction 2026-03-10 16:22:10 -07:00
Saurav Panda
ce25884751 fix: prevent duplicate items in multi-page extraction via already_collected parameter 2026-03-10 16:12:46 -07:00
Saurav Panda
21912adbf5 fix: detect empty DOM after navigation and retry before reporting failure (#4319)
## Problem

After a successful navigate() call, the agent had no way to detect that
the page actually loaded empty content. The navigation event would
complete without error, the agent would see an empty DOM, and then fail
or give up with no retry or meaningful error.

This was happening in ~12k+ cases across multiple patterns:
- Pages that use JavaScript rendering that silently fails
- Sites that serve blank pages as anti-bot responses
- Tunnel/proxy connection errors (ERR_TUNNEL_CONNECTION_FAILED) landing
on error pages with no DOM

## Fix

Changes are in browser_use/tools/service.py, navigate() action:

**1. Post-navigation DOM health check**
After navigation completes for http/https URLs, calls
get_browser_state_summary() to inspect dom_state._root. If None (empty
DOM), waits 3 seconds and rechecks once. If still empty after the wait,
returns a descriptive ActionResult(error=...) so the agent can reason
about it and try a different approach, instead of silently proceeding
with an empty page.

**2. ERR_TUNNEL_CONNECTION_FAILED added to network error patterns**
Made explicit alongside the existing net:: catch for correctness and
clarity.

## Tickets Fixed

- Fixes ENG-3469: Agent fails when page loads empty DOM or blank content
- Fixes ENG-2920: Page has empty DOM after navigation, agent does not
wait or retry before failing
- Fixes ENG-3404: Websites render with empty DOM preventing all content
interaction
- Fixes ENG-3311: Website fails to load (empty DOM) preventing contact
form and task execution
2026-03-10 16:01:02 -07:00
Saurav Panda
bf6bb01430 Merge branch 'main' into empty-dom-after-navigation 2026-03-10 15:58:02 -07:00
Saurav Panda
53b0239677 recompute the url scheme after refresh 2026-03-10 15:56:21 -07:00
Saurav Panda
1d9049fcad fix: detect empty DOM after navigation and retry before reporting failur 2026-03-10 15:40:19 -07:00
Claude
26ed331cbb Remove $10 free credit mentions from documentation
Removes references to $10 signup credits from README.md and AGENTS.md
as this promotion is being discontinued.

https://claude.ai/code/session_01CTCYfXrPi3SxEZeBy9DevS
2026-03-10 22:06:46 +00:00
Saurav Panda
9324cf6b8a added check for hard constraints (#4318)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added hard-constraint enforcement to all browser-use system prompts so
the agent avoids actions that violate explicit "do
NOT/never/avoid/skip/only X" instructions. This improves safety and task
compliance across modes.

- **New Features**
- Added a <constraint_enforcement> block to
`system_prompt_browser_use*.md` and `system_prompt_flash*.md` that
checks hard constraints before each action.
- Made hard-constraint checking the first item in Critical Reminders
across standard and no-thinking prompts, keeping existing guidance
intact.

<sup>Written for commit 081e4ee94f.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-10 15:00:35 -07:00
Saurav Panda
081e4ee94f added check for hard constraints 2026-03-10 12:45:02 -07:00
Reagan Hsu
028c2868cf Delete docs directory (#4309)
open source documentation has been combined with cloud documentation at
docs.browser-use.com/open-source and docs.browser-use.com/cloud.
2026-03-08 23:49:20 -07:00
Reagan Hsu
809d2687c6 Delete docs directory
open source documentation has been combined with cloud documentation at docs.browser-use.com/open-source and docs.browser-use.com/cloud.
2026-03-08 23:47:54 -07:00
Reagan Hsu
c65b74b772 Update documentation links in README.md (#4308) 2026-03-08 23:10:23 -07:00
Reagan Hsu
34456c5a20 Update documentation links in README.md 2026-03-08 23:08:54 -07:00
Saurav Panda
9b103bb1d4 Merge branch 'main' of https://github.com/browser-use/browser-use into worktree-agent-a7f83756 2026-03-07 16:36:14 -08:00
Saurav Panda
2895720eb0 fix: remove unused variable assignments 2026-03-07 14:37:31 -08:00
Saurav Panda
2344df3fac fix: pass through timeout_ms and clip params in event handlers 2026-03-07 14:34:08 -08:00
laithrw
7a2f554038 don't explicitly pass newWindow: false to CDP createTarget (#4283)
Resolves #3908

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Stop sending newWindow: false to CDP Target.createTarget using
CreateTargetParameters. Only include newWindow when true, relying on
Chrome defaults for consistent tab creation; minor lint.

<sup>Written for commit b630ae596e.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-06 11:53:23 -05:00
Laith Weinberger
b630ae596e lint 2026-03-06 11:37:38 -05:00
Laith Weinberger
b051fe2a7a don't explicitly pass newWindow: false to CDP createTarget 2026-03-06 11:28:36 -05:00
Saurav Panda
bf7775dc85 Update pyproject.toml (#4265)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Updated pyproject.toml to bump the package version from 0.12.0 to
0.12.1. This prepares the 0.12.1 patch release and aligns the package
metadata with the release branch.

<sup>Written for commit 1536654073.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
0.12.1
2026-03-02 17:52:30 -08:00
Saurav Panda
1536654073 Update pyproject.toml 2026-03-02 17:35:31 -08:00
Saurav Panda
233f7f9434 fix: allow cross-origin iframe targets with empty URLs through _is_va… (#4264)
…lid_target()

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Allow iframe and webview targets that initially report an empty URL to
pass _is_valid_target(). This restores OOPIF frame discovery so
get_all_frames() can resolve full frame trees.

<sup>Written for commit 83908a7de1.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-02 16:48:45 -08:00
Saurav Panda
83908a7de1 Merge branch 'main' into ph-launch 2026-03-02 16:40:22 -08:00
Saurav Panda
10b5d1cd88 fix: allow cross-origin iframe targets with empty URLs through _is_valid_target() 2026-03-02 16:36:39 -08:00
shawn pana
b3341bc055 Update docs (#4263)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Adds Cloud entry points and a version switcher, and moves deprecated
Code Agent, Actor, and Sandbox docs into a new Legacy section. Updates
navigation and redirects so existing links continue to work.

- **New Features**
  - Adds Open Source / Cloud version switcher to the navbar.
  - Adds /cloud and /use-cloud pages that redirect to Cloud docs.
  - Updates the Introduction “Cloud Setup” card to link to /cloud.

- **Refactors**
- Moves Code Agent, Actor, and Sandbox docs under docs/legacy and adds a
“Legacy” nav group.
  - Updates internal links (AGENTS.md and MDX) to /legacy paths.
- Adds redirects from old customize paths and /production to their
/legacy equivalents; redirects /use-claude to /use-cloud.

<sup>Written for commit 6c24c9d841.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-02 16:27:03 -08:00
ShawnPana
6c24c9d841 Add Open Source / Cloud version dropdown to navbar
Add Mintlify versions switcher with Open Source (all existing docs)
and Cloud (redirects to docs.cloud.browser-use.com). Update intro
card to use /cloud redirect path for consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:01:13 -08:00
ShawnPana
3b78ffc50c Rename Use Claude to Use Cloud
Rename use-claude.mdx to use-cloud.mdx, update nav and redirects.
Add backward-compat redirect from /use-claude to /use-cloud.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:41:03 -08:00
ShawnPana
96f39b3c75 Move Code Agent, Actor, and Sandbox docs to Legacy section
Relocate deprecated doc sections from customize/ to legacy/ under
Customize OS nav. Add redirects for all old paths and update
cross-references in AGENTS.md and related mdx files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:30:39 -08:00
Magnus Müller
5ace60848b Docs production to Claude (#4251)
Replaces "Going to Production" in the navigation with "Use Claude"
linking to external documentation and adds redirects for both the old
and new paths.

---
[Slack
Thread](https://browser-use.slack.com/archives/C08P3EMVDJ5/p1772383713309059?thread_ts=1772383713.309059&cid=C08P3EMVDJ5)

<p><a
href="https://cursor.com/agents/bc-1811c281-8c26-51ae-84d3-dc7235a73544"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a
href="https://cursor.com/background-agent?bcId=bc-1811c281-8c26-51ae-84d3-dc7235a73544"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</p>



<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Replaces the “Going to Production” docs nav item with “Use Claude,”
which links to our external Claude docs. Adds redirects (/use-claude →
external Claude docs, /production → /customize/sandbox/quickstart) and
removes the old production page.

<sup>Written for commit e1b450ddf4.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 23:00:43 -08:00
Magnus Müller
4ae7647472 Merge branch 'main' into cursor/docs-production-to-claude-72c8 2026-03-01 23:00:26 -08:00
laithrw
a1f767406a fix channel param to select correct browser binary (#4256)
Resolves #3015 and mismatch with BrowserChannel in profile.py

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes browser selection by prioritizing the requested channel when
finding the local binary. Prevents launching the wrong browser and
aligns LocalBrowserWatchdog with profile.channel.

- **Bug Fixes**
- Pass profile.channel to _find_installed_browser_path and prioritize
channel-specific paths; skip prioritization when channel is default.
- Map BrowserChannel values to path groups and expand OS coverage,
including Edge paths on macOS and Linux.
- Keep a clear fallback order (system Chrome → Playwright Chromium →
other browsers incl. Canary/Dev/Brave/Edge → headless shell).

<sup>Written for commit f5df080b41.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 16:28:44 -05:00
Laith Weinberger
f5df080b41 lint 2026-03-01 16:21:49 -05:00
Laith Weinberger
209866ed5b fix channel param to select correct browser binary 2026-03-01 16:17:18 -05:00
laithrw
71ad655d73 fix(#3934): use MCP ImageContent for screenshots instead of embedding base64 in JSON (#4255)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Screenshots are now returned as MCP ImageContent instead of base64 in
JSON. This reduces payload size and aligns outputs with MCP content
types for browser_get_state and browser_screenshot.

- **Refactors**
- Updated handle_call_tool to return mixed content lists (TextContent +
ImageContent) when tools produce images.
- Changed _get_browser_state and _screenshot to return (metadata_json,
screenshot_b64 | None); dimensions remain in metadata.
- Removed embedded "screenshot" from JSON; kept "size_bytes" and
"viewport".
- Updated browser_screenshot tool description to reflect the new format.
  - Lint cleanup and synced with main; no functional changes.

- **Migration**
- Update clients to handle ImageContent in tool responses; parse
TextContent for metadata and use ImageContent for the image.
- Do not read "screenshot" from JSON; use "screenshot_dimensions"
(browser_get_state) or "viewport" (browser_screenshot) for coordinates.
- Expect handle_call_tool to return a list of content items for
image-producing tools.

<sup>Written for commit a1e54eff0e.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 16:08:17 -05:00
laithrw
a1e54eff0e Merge branch 'main' into fix/mcp-screenshot-imagecontent 2026-03-01 16:05:27 -05:00
Laith Weinberger
086f18cf53 lint 2026-03-01 16:05:07 -05:00
Laith Weinberger
3a03d14f9b use MCP ImageContent for screenshots instead of embedding base64 in JSON 2026-03-01 15:59:18 -05:00
laithrw
20aac7babd fix(mcp): ensure extracted content is used in next step (#2582) (#3886)
Fixes: #2582

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes #2582 by ensuring MCP extracted_content is used only in the next
step, preventing repeated inclusion later. Sets
include_extracted_content_only_once=True on ActionResult in both MCP
client action wrappers.

<sup>Written for commit c330212e60.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 15:15:24 -05:00
laithrw
c330212e60 Merge branch 'main' into fix/2582-mcp-action-result 2026-03-01 15:09:47 -05:00
laithrw
aea64d73d5 fix(#3124): wrong bedrock import paths in docs (#4253)
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Fixed AWS Bedrock import paths in the docs so users import
ChatAWSBedrock and ChatAnthropicBedrock from browser_use.llm, not
browser_use. Prevents ImportError and aligns with the current package
structure (Linear #3124).

<sup>Written for commit 94bc07b87d.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 15:02:23 -05:00
Laith Weinberger
94bc07b87d fix bedrock import paths in docs 2026-03-01 14:45:06 -05:00
laithrw
2da1ed7d58 fix(agent): disable json escaping in conversation history (#3878)
Fixes:#3090
Root Cause Identification: The issue was caused by Python's json.dump()
function, which defaults to ensure_ascii=True. This default behavior
converts all non-ASCII characters (like Chinese, Japanese, Emojis) into
Unicode escape sequences (e.g., \u4f60).
The Fix: I explicitly added ensure_ascii=False to the 
save_to_file
 method in 
browser_use/agent/views.py
. This tells the JSON serializer to write the characters directly as
UTF-8.
Verification: I ran a specific test script that:
Saved a file with Chinese characters using the original method
$\rightarrow$ FAIL (Result was \u...)
Saved a file with Chinese characters using the fixed method
$\rightarrow$ PASS (Result was readable text like 你好)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Preserves non-ASCII characters across all JSON outputs by using
ensure_ascii=False and explicit UTF-8 encoding. Covers conversation
history, storage state (session + watchdog), HAR recordings, cookie
export, command_history.json, and code_use view saves, fixing #3090.

<sup>Written for commit 2a8f2a0bed.
Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
2026-03-01 14:27:17 -05:00
laithrw
2a8f2a0bed Merge branch 'main' into fix/3090-json-escaping 2026-03-01 14:21:25 -05:00