Repository navigation
Anthropic browser toolset: use the released SDK names (fixes pyright on main) - #6076
Merged
Merged
Conversation
anthropic 1.14.0 ships the browser toolset as BetaBrowserState, BetaScreenshotResult and BetaLocalFilePolicy, and exports ToolError from anthropic.tools. The adapter still imported the pre-release names, so `import browser_use.integrations.anthropic.browser_use` raised ImportError on the current SDK and pyright failed on main (blocking every PR's code-style and type-checker checks). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FtaLtmtYzypkdaUnjCHT6U
Agent Task Evaluation Results: 2/2 (100%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change: the Claude browser-toolset adapter and its example import the names anthropic 1.14.0 actually ships:
BrowserState->BetaBrowserStateBetaBrowserScreenshotResult->BetaScreenshotResultLocalFilePolicy->BetaLocalFilePolicy,ConfirmContext->BetaConfirmContextToolErrorfromanthropic.tools(no longer re-exported fromanthropic.tools.browser)Why: with the current SDK, importing
browser_use.integrations.anthropic.browser_useraises ImportError, and pyright reports 4 errors on main. That fails the requiredcode-styleandtype-checkerchecks on every open PR (e.g. #6072). Fields are unchanged (BetaBrowserState(tabs, state_changes),BetaScreenshotResult(data),BetaLocalFilePolicy(upload_roots=..., upload_document_ids=...)), so this is a pure rename.Proof (anthropic 1.14.0, local
uv sync --dev):pyrightwhole repo: main 4 errors -> this branch 0.pytest tests/ci/integrations/test_anthropic_browser_use.py: main 1 failed (test_browser_use_and_bash_construct_with_a_compatible_sdk) -> this branch 11 passed, 1 skipped (the skip is the "SDK already includes browser tools" case).ruff check/ruff format --checkon changed files: clean.Risk: users pinned to a pre-release SDK that only had the old names would now fail to import;
pyprojectalready allows anyanthropic>=0.76,<2, and the released SDK is the one CI and new installs resolve. Rollback: revert.🤖 Generated with Claude Code
https://claude.ai/code/session_01FtaLtmtYzypkdaUnjCHT6U
Summary by cubic
Fixes the Anthropic browser toolset adapter to use the names shipped in the released anthropic 1.14.0 SDK, so importing
browser_use.integrations.anthropic.browser_useno longer raises ImportError and pyright passes on main.BrowserState→BetaBrowserState,BetaBrowserScreenshotResult→BetaScreenshotResult,LocalFilePolicy→BetaLocalFilePolicy, andConfirmContext→BetaConfirmContext.ToolErrorfromanthropic.toolsinstead ofanthropic.tools.browser.Users pinned to a pre-release SDK that only had the old names would fail to import; rollback is a revert.
Written for commit a428215. Summary will update on new commits.