Repository navigation
Conversation
🦋 Changeset detectedLatest commit: a91cae9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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 |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Ext as Stagehand Extension
participant LLM as LLM Service
participant SDK as AI SDK (ai + @ai-sdk/anthropic)
participant Provider as Anthropic Provider
participant API as Anthropic API (Opus 5.5)
Note over Ext,API: Structured Output Flow (act/observe/extract)
Ext->>LLM: generate() with tool definitions + tool_choice: "required"
LLM->>SDK: generateText() with structured output config
SDK->>Provider: Convert to Anthropic Responses API format
Provider->>API: POST /v1/messages/responses (native tool use)
API-->>Provider: Response with function_call output
Provider->>Provider: Process native structured output
Provider-->>SDK: Return validated tool call result
SDK-->>LLM: Tool call result
LLM-->>Ext: Parsed action/observation/extraction
Note over SDK,Provider: Version alignment
SDK->>SDK: Ensure @ai-sdk/provider version compatibility
SDK->>Provider: Shared provider interface contract
Note over Provider,API: Opus 5.5 native structured output
alt Native structured output supported (new SDK)
Provider->>API: Use native tool_choice (no forced "any")
API-->>Provider: Tool call in output
else Legacy forced tool choice (old SDK)
Provider->>API: Send tool_choice: { type: "any" }
API-->>Provider: Rejected - 400 error (model incompatibility)
end
Note over LLM,Provider: Gateway Test Fixture (NEW)
LLM->>Provider: Simulate reply with no tool call
Provider->>Provider: NEW: Validate tool_choice "required" + missing call
Provider-->>LLM: Reject with error
LLM-->>Ext: Handle error as no valid tool call
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
…date changeset for python
seanmcguire12
approved these changes
Oct 29, 2026
akeimach
deleted the
alyssamaruyama/ap-3103-upgrade-ai-sdk-for-opus-55-compatibility
branch
October 29, 2026 18:59
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.
why
Fixes #3337
The extension used
@ai-sdk/anthropic4.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,observeandextractwere also failing.what changed
@ai-sdk/anthropicto ^4.0.90. This version uses native structured output for Opus 5.5.aito ^7.0.155. It must use the same@ai-sdk/providerversion as the new Anthropic package.@ai-sdk/anthropicto 4.0.26 in mastra-sdk to match the@ai-sdk/providerversion that@mastra/coreusestest plan
Summary by cubic
Bumps
@ai-sdk/anthropicandaiin the extension so it works with Claude Opus 5.5, fixingact,observe, andextractfailures for that model.tool_choice: { type: "any" }) were rejected by Opus 5.5.NativeMastraModeltype to accept both OpenAI and Anthropic models, since providers can use different@ai-sdk/providerversions.Written for commit a91cae9. Summary will update on new commits.