Skip to content

fix(anthropic): skip passing beta header for tool search tools#13496

Merged
aayush-kapoor merged 3 commits intomainfrom
aayush/vertex-tool-search
Mar 16, 2026
Merged

fix(anthropic): skip passing beta header for tool search tools#13496
aayush-kapoor merged 3 commits intomainfrom
aayush/vertex-tool-search

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented Mar 16, 2026

Background

The tool search tools don't require the beta header to be passed anymore in the request (removed from the documentation)

it was still passed in the request with AI SDK. When passed, it is rejected by providers such as Google Vertex (explored in PR #13497 )

Summary

remove the addition of the beta header advanced-tool-use-2025-11-20 in the prepare tools file

Manual Verification

verified by running the existing examples before and after the fix:

  • examples/ai-functions/src/generate-text/anthropic/tool-search-regex.ts
  • examples/ai-functions/src/generate-text/anthropic/tool-search-deferred-bm25.ts
  • examples/ai-functions/src/generate-text/anthropic/tool-search-bm25.ts

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

@tigent tigent bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/google-vertex Issues related to the @ai-sdk/google-vertex provider labels Mar 16, 2026
{
"anthropic-beta": "advanced-tool-use-2025-11-20,structured-outputs-2025-11-13",
"anthropic-beta": "structured-outputs-2025-11-13",
"anthropic-version": "2023-06-01",
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

expected regression in this file since the test is explicitly only for the tool search tools

@aayush-kapoor aayush-kapoor added the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 16, 2026
@aayush-kapoor aayush-kapoor merged commit 21d1ee3 into main Mar 16, 2026
22 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/vertex-tool-search branch March 16, 2026 20:07
vercel-ai-sdk bot pushed a commit that referenced this pull request Mar 16, 2026
## Background

The tool search tools don't require the beta header to be passed anymore
in the request ([removed from the
documentation](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool))

it was still passed in the request with AI SDK. When passed, it is
rejected by providers such as Google Vertex (explored in PR
#13497 )

## Summary

remove the addition of the beta header `advanced-tool-use-2025-11-20` in
the prepare tools file

## Manual Verification

verified by running the existing examples before and after the fix:
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-regex.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-deferred-bm25.ts`
-
`examples/ai-functions/src/generate-text/anthropic/tool-search-bm25.ts`

## Checklist

- [x] Tests have been added / updated (for bug fixes / features)
- [ ] Documentation has been added / updated (for bug fixes / features)
- [x] A _patch_ changeset for relevant packages has been added (for bug
fixes / features - run `pnpm changeset` in the project root)
- [x] I have reviewed this pull request (self-review)
@vercel-ai-sdk vercel-ai-sdk bot removed the backport Admins only: add this label to a pull request in order to backport it to the prior version label Mar 16, 2026
@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 16, 2026

✅ Backport PR created: #13500

@vercel-ai-sdk
Copy link
Copy Markdown
Contributor

vercel-ai-sdk bot commented Mar 16, 2026

🚀 Published in:

Package Version
@ai-sdk/amazon-bedrock 5.0.0-beta.6
@ai-sdk/anthropic 4.0.0-beta.6
@ai-sdk/google-vertex 5.0.0-beta.14

vercel-ai-sdk bot added a commit that referenced this pull request Mar 16, 2026
…ols (#13500)

This is an automated backport of #13496 to the release-v6.0 branch. FYI
@aayush-kapoor

Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label bug Something isn't working as documented provider/anthropic Issues related to the @ai-sdk/anthropic provider provider/google-vertex Issues related to the @ai-sdk/google-vertex provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants