[fix]: bump ai-sdk for opus 5.5 support

Merged
AK
3h ago
+111-65

why

Fixes https://github.com/browserbase/stagehand/issues/3337

The extension used @ai-sdk/anthropic 4.0.8 which predates opus 5.5. For structured output, it sent a forced tool call (tool_choice: { type: "any" }), which opus 5.5 rejected. Because of this, act, observe and extract were also failing.

what changed

  • Bump @ai-sdk/anthropic to ^4.0.90. This version uses native structured output for Opus 5.5.
  • Bump ai to ^7.0.155. It must use the same @ai-sdk/provider version as the new Anthropic package.
  • Pin @ai-sdk/anthropic to 4.0.26 in mastra-sdk to match the @ai-sdk/provider version that @mastra/core uses

test plan

  • Added a gateway test fixture to catch when tool choice is required but the reply has no tool call

Summary by cubic

Bumps @ai-sdk/anthropic and ai in the extension so it works with Claude Opus 5.5, fixing act, observe, and extract failures for that model.

  • Fixes #3337, where forced tool calls (tool_choice: { type: "any" }) were rejected by Opus 5.5.
  • Updates the mastra-sdk NativeMastraModel type to accept both OpenAI and Anthropic models, since providers can use different @ai-sdk/provider versions.
  • Adds a gateway test fixture to catch when tool choice is required but the reply has no tool call.