Skip to content

[feat] Add BrowserUseTools for Browser Use Cloud browser tasks - #11103

Draft
gregpr07 wants to merge 1 commit into
agno-agi:mainfrom
gregpr07:feat/browser-use-tools
Draft

gregpr07 wants to merge 1 commit into
agno-agi:mainfrom
gregpr07:feat/browser-use-tools

Conversation

@gregpr07

Copy link
Copy Markdown

Summary

Adds BrowserUseTools (libs/agno/agno/tools/browser_use.py). One tool, run_browser_task(task, session_id=None), sync and async. It runs the task on the Browser Use Cloud agent (API v4, official browser-use-sdk), waits, and returns {"result", "session_id", "run_id"} as JSON. Passing session_id back continues in the same browser. Errors come back as {"error": ...} JSON.

  • timeout (default 900 s) is forwarded to Toolkit; a run that exceeds it is cancelled so it stops using credits
  • Optional extra browser-use = ["browser-use-sdk>=3.10.0"], added to agno[tools]; mypy override for browser_use_sdk.* (the SDK ships no py.typed)
  • Cookbook cookbook/91_tools/browser_use_tools.py, README section, TEST_LOG entry

Why: BrowserbaseTools exposes low-level page actions. This hands a whole multi-step task (click, fill forms, log in, extract) to a hosted browser agent.

Fixes #11093

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Duplicate and AI-Generated PR Check

  • I have searched existing open pull requests and confirmed that no other PR already addresses this issue
  • If a similar PR exists, I have explained below why this PR is a better approach
  • Check if this PR was entirely AI-generated (by Copilot, Claude Code, Cursor, etc.)

Additional Notes

Proof:

  • pytest libs/agno/tests/unit/tools/test_browser_use.py -> 9 passed on browser-use-sdk 3.10.0 and on 3.11.3. Tests run the real SDK against a fake API v4 over httpx.MockTransport: request body, follow-up session, failed run, API error, missing key sends no request, timeout cancels the run (sync and async), tool registration.
  • A mutation check (drop the cancel call, drop session_id) fails 3 tests.
  • ./scripts/validate.sh: ruff clean for agno, agnoctl and cookbook; cookbook pattern check clean; mypy reports 7 errors, all in untouched files under agno/db/ and agno/os/ and identical on main with the same local mypy, none in the new module. ruff format run on the changed files only.
  • uv pip compile --extra tests before/after: the only change is browser-use-sdk==3.10.0 (no other version moves).
  • Not run: a live call against Browser Use Cloud, which needs a funded key.

Risk: additive (new module, optional extra). Rollback: revert the commit.

🤖 Generated with Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add BrowserUseTools toolkit (run browser tasks on Browser Use Cloud)

1 participant