Skip to content

fix(anthropic): handle web_fetch_tool_result content blocks in streaming and message serialization - #11064

Open
Harjot Singh (imharjot) wants to merge 1 commit into
langchain-ai:mainfrom
imharjot:fix/anthropic-web-fetch-tool-result
Open

Harjot Singh (imharjot) wants to merge 1 commit into
langchain-ai:mainfrom
imharjot:fix/anthropic-web-fetch-tool-result

Conversation

@imharjot

@imharjot Harjot Singh (imharjot) commented Jun 13, 2026 •

Copy link
Copy Markdown

Preserve Anthropic web_fetch_tool_result blocks during streaming and when serializing the next conversation turn. Both allowlists now handle them alongside web_search_tool_result, while retaining the current base's tool-search support.

Added regressions for a streamed result block and a message round-trip. Both fail without the allowlist entries. Included a patch changeset.

Validation: all 312 @langchain/anthropic unit tests passed, the provider build passed its declaration and package checks, changed files pass formatting, and repository lint exits successfully with an existing unrelated warning.

Fixes #9911

@changeset-bot

changeset-bot Bot commented Jun 13, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7b396e6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@langchain/anthropic Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@imharjot
Harjot Singh (imharjot) force-pushed the fix/anthropic-web-fetch-tool-result branch from 8452a88 to 7b396e6 Compare October 4, 2026 13:50
@imharjot

Harjot Singh (imharjot) commented Oct 4, 2026 •

Copy link
Copy Markdown
Author

Rebased onto current main and preserved the newer tool-search entries when resolving the conflict. Both web-fetch regressions fail without the fix. The full Anthropic unit suite (312 tests), provider build, formatting and repository lint pass locally.

The refreshed GitHub workflows are marked action_required. Could a maintainer approve or unblock the fork workflows so the remote checks can run?

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.

ChatAnthropic + web_search + streaming = invalid_tool_calls

1 participant