Skip to content

Anthropic browser toolset: use the released SDK names (fixes pyright on main) - #6076

Merged
gregpr07 merged 1 commit into
mainfrom
fix/anthropic-sdk-browser-toolset-names
Oct 15, 2026
Merged

gregpr07 merged 1 commit into
mainfrom
fix/anthropic-sdk-browser-toolset-names

Conversation

@gregpr07

@gregpr07 gregpr07 commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Change: the Claude browser-toolset adapter and its example import the names anthropic 1.14.0 actually ships:

  • BrowserState -> BetaBrowserState
  • BetaBrowserScreenshotResult -> BetaScreenshotResult
  • LocalFilePolicy -> BetaLocalFilePolicy, ConfirmContext -> BetaConfirmContext
  • ToolError from anthropic.tools (no longer re-exported from anthropic.tools.browser)

Why: with the current SDK, importing browser_use.integrations.anthropic.browser_use raises ImportError, and pyright reports 4 errors on main. That fails the required code-style and type-checker checks 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):

  • pyright whole 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 --check on changed files: clean.

Risk: users pinned to a pre-release SDK that only had the old names would now fail to import; pyproject already allows any anthropic>=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_use no longer raises ImportError and pyright passes on main.

  • Renames BrowserState → BetaBrowserState, BetaBrowserScreenshotResult → BetaScreenshotResult, LocalFilePolicy → BetaLocalFilePolicy, and ConfirmContext → BetaConfirmContext.
  • Imports ToolError from anthropic.tools instead of anthropic.tools.browser.
  • Updates the Claude toolset example README and quickstart to the new names.

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.

View guided diff Turn on auto-fix

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
@github-actions

Copy link
Copy Markdown

Agent Task Evaluation Results: 2/2 (100%)

View detailed results
Task Result Reason
browser_use_pip ✅ Pass Skipped - API key not available (fork PR or missing secret)
amazon_laptop ✅ Pass Skipped - API key not available (fork PR or missing secret)

Check the evaluate-tasks job for detailed task execution logs.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@gregpr07
gregpr07 merged commit 4856bfb into main Oct 15, 2026
133 checks passed
@gregpr07
gregpr07 deleted the fix/anthropic-sdk-browser-toolset-names branch October 15, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant