Commit 5a3c6f8
Adds zoom tool for Opus 4.5 (#309)
* Add browser automation tool from anthropics/anthropic#148306
Implements a dedicated browser tool for web automation tasks as an
alternative to full computer use. The browser tool provides specialized
actions for navigating, clicking, typing, and scrolling in Firefox.
Key features:
- New BrowserTool20250910 with browser-specific actions
- Auto-launch Firefox if not running
- Graceful browser close functionality
- Model mapping for bobcat models to use browser mode
- Browser-specific system prompt and UI updates
Changes:
- Add computer_use_demo/tools/browser.py with full browser automation
- Add browser_use_20250910 tool version to groups.py
- Map bobcat-latest/bobcat-v17-prod to browser mode in streamlit.py
- Add BROWSER_SYSTEM_PROMPT for browser-specific instructions
- Fix session state handling and base64 encoding issues
- Add comprehensive browser tool tests
Original implementation by benkomalo, sagnik, and brigit
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix browser tool initialization and improve startup reliability
- Fix session state initialization for tool_versions to prevent AttributeError
- Improve browser window detection using xdotool instead of process check
- Add window focus activation to ensure browser is ready for commands
- Add polling mechanism to wait for Firefox window (up to 15s)
- Add dynamic page title based on tool mode (browser vs computer use)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* save but screenshot too big
* before going for everything
* actual multi-session
* everything works
* refactor
* Add browser-use-demo quickstart for Browser Use API
Create dedicated quickstart for Browser Use API demonstration using Playwright
with Chromium. Runs fully containerized for security and isolation.
- Separate quickstart focused solely on browser automation (split from computer-use-demo)
- Container-based Playwright Chrome browser for secure execution
- Streamlit UI with inline action display showing tool usage
- Support for Claude 4+ models with browser_use capability
- Port 8080 for main UI, 6080 for NoVNC browser view
Based on initial implementation by @bassil
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update model name from bobcat to claude-boucle-eap
* Remove browser functionality from computer-use-demo
Browser functionality has been moved to its own dedicated quickstart (browser-use-demo).
This keeps computer-use-demo focused solely on computer use capabilities.
* Remove remaining browser-related files from computer-use-demo
Remove README_LOCAL.md, run_local.py, and setup.py as these were for
local browser mode which has been moved to browser-use-demo
* Improve browser resolution configuration and security
- Set default resolution to 1920x1080 for better modern web compatibility
- Add environment-based configuration via .env file for all settings
- Remove bind mounts in favor of Docker watch for better security
- Add validation script to ensure proper configuration at startup
- Create docker-compose.yml for easier deployment
- Update documentation with new setup instructions
The container now fails fast with helpful error messages if not properly
configured, and uses Docker's watch feature for development instead of
bind mounts to prevent container from modifying host files.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Rename browser-use-demo to browser-tools-api-demo
Changes:
- Renamed directory from browser-use-demo to browser-tools-api-demo
- Updated Python module from browser_use_demo to browser_tools_api_demo
- Changed container user from browseruse to browsertoolsapi
- Updated all references in documentation, Docker configs, and code
- Removed docker run instructions in favor of docker-compose
- Updated window titles and demo names throughout
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Change default model to claude-boucle-eap in browser-tools-api-demo
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update README.md
updated readme with additional instructions
* Create browser-tools-api.md
Doc explaining difference between browser tools api & computer use
* Rename browser-tools-api.md to browser_tools_api.md
renaming
* Update browser API beta flag from browser-use to browser-tools
- Change API header from browser-use-2025-09-10 to browser-tools-2025-09-10
- Rename constant BROWSER_USE_BETA_FLAG to BROWSER_TOOLS_BETA_FLAG
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Add Browser Tools API Demo to root README
Added the Browser Tools API Demo quickstart to the main README with the same format as existing demos. This provides a complete reference implementation for browser automation using Claude's browser tools API.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix Xvfb startup issue with stale lock files in browser-tools-api-demo
When docker-compose stops and restarts the container, Xvfb lock files
persist, causing the startup script to incorrectly assume Xvfb is running.
This leads to tint2 failing with "could not open display!" error.
The fix enhances xvfb_startup.sh to:
- Check if the display is actually accessible (not just if lock exists)
- Clean up stale lock files and sockets when display is inaccessible
- Start Xvfb fresh when needed
This makes the container startup idempotent and resolves the restart issue.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update browser_tools_api.md
Fixed typos & added safety considerations section
* Update README.md
Add safety section, made browser name consistent "browser tool API" and cleaned up typos
* Update browser_tools_api.md
Changed "browser tool" --> "browser tools"
* Update README.md
"Browser tool" --> "Browser tools"
* Update README.md
Small edits to security considerations
* Update browser_tools_api.md
Small changes to safety section
* Update README.md
typo fix
* Add Playwright attribution and legal notices
Add required attribution for Microsoft Playwright components used in the browser-tools-api-demo:
- Add NOTICE file with Playwright attribution
- Add modification headers to files derived from Playwright source (browser_dom_script.js, browser_element_script.js, browser.py)
- Update README with reference to NOTICE file
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Add CHANGELOG.md and update attribution headers
- Create CHANGELOG.md to track modification dates and details centrally
- Update file headers to reference CHANGELOG.md instead of inline dates
- Update NOTICE to reference CHANGELOG.md
This allows easier maintenance of modification history going forward.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Add legal guidance to CLAUDE.md
Add requirement to track copyright notice modifications in CHANGELOG.md files.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix browser state continuity and click targeting
Previously, when issuing follow-up instructions, the browser would restart
from the beginning instead of continuing from the current state. Additionally,
clicks were sometimes missing their targets due to viewport sizing issues.
Issues fixed:
1. Message history not being preserved - streamlit was stripping out the
full conversation context when preparing API messages
2. Event loop incompatibility - using asyncio.run() for each turn created
a new event loop, breaking Playwright's browser instance
3. Browser window/viewport sizing causing click coordinate misalignment
Changes:
- Preserve full message history in streamlit.py to maintain conversation context
- Implement persistent event loop to keep browser instance alive across turns
- Integrate screenshots with user messages to show current browser state
- Enable screenshot filtering (keep 3 most recent) to manage context size
- Remove event loop reset logic in browser.py that was causing browser restarts
- Fix browser window sizing and viewport configuration for accurate click targeting
- Add helpful debug logging for browser state tracking
The browser now successfully maintains state across multiple requests,
continues from where it left off, and clicks work reliably.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Fix claude-sonnet-4-5-20250929 tool compatibility
- Add EditTool20250728 with text_editor_20250728 API type and str_replace_based_edit_tool name
- Update computer_use_20250124 to use EditTool20250728 instead of EditTool20250124
- Add CLAUDE_4_5 model configuration using computer_use_20250124 tool version
- Update model mapping to use CLAUDE_4_5 for claude-sonnet-4-5-20250929
- Set claude-sonnet-4-5-20250929 as the default model
This resolves the "does not support tool types: text_editor_20250124" error
by using the official tool types supported by the model: bash_20250124,
computer_20250124, text_editor_20250728.
Uses official computer_use_20250124 tool version instead of inventing a new one.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* Update README to reflect Claude 4.5 Sonnet as default model
Updates the default model reference from claude-sonnet-4-20250514 to
claude-sonnet-4-5-20250929 in the README note section.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
* remove unused import
* Add support for a new zoom action in computer_use_20251124
This overhauls a bunch of things, including:
- adds the new `computer_use_20251124` variant, with the zoom action
- removes a bunch of older models that are deprecated
- adds a bunch of newer models that were missing
- replaces the buggy text editor 0429 with the correct 0728 version
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Bassil Shama <[email protected]>
Co-authored-by: brigitanthropic <[email protected]>
Co-authored-by: Alex Paris <[email protected]>
Co-authored-by: Ben Komalo <[email protected]>1 parent 9bcc95e commit 5a3c6f8
File tree
50 files changed
+4164
-111
lines changed- browser-tools-api-demo
- browser_tools_api_demo
- browser_tool_utils
- tools
- image
- .config/tint2
- applications
- static_content
- computer-use-demo
- computer_use_demo
- tools
- tests
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+4164
-111
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
| 62 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
31 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments