Skip to content

remove strictJson schema#2028

Merged
tkattkat merged 1 commit intomainfrom
remove-deprecated-structured-output-option
Apr 22, 2026
Merged

remove strictJson schema#2028
tkattkat merged 1 commit intomainfrom
remove-deprecated-structured-output-option

Conversation

@tkattkat
Copy link
Copy Markdown
Collaborator

@tkattkat tkattkat commented Apr 22, 2026

why

Structured output mode is deprecated

what changed

removed usage of anthropic structured output mode

test plan

Ran tests locally + CI tests


Summary by cubic

Removed the deprecated anthropic.structuredOutputMode option from AISdk provider options to align with Anthropic’s deprecation and avoid sending unsupported flags. Updated unit tests and added a changeset; behavior for other providers is unchanged.

Written for commit 64daca7. Summary will update on new commits. Review in cubic

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

🦋 Changeset detected

Latest commit: 64daca7

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

This PR includes changesets to release 4 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-evals Patch
@browserbasehq/stagehand-server-v3 Patch
@browserbasehq/stagehand-server-v4 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

Copy link
Copy Markdown
Contributor

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

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

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant App as Stagehand Client
    participant SDK as AISdkClient (lib/v3/llm/aisdk.ts)
    participant VercelSDK as Vercel AI SDK
    participant Anthropic as Anthropic API

    Note over App, Anthropic: Initialization & Configuration Flow

    App->>SDK: initialize(modelName)
    SDK->>SDK: Parse provider from modelName

    alt provider == "anthropic"
        SDK->>SDK: CHANGED: Skip setting structuredOutputMode
        Note right of SDK: Removed deprecated "auto" flag
    else provider == "openai" or "azure"
        SDK->>SDK: Set strictJsonSchema: true
    else provider == "google" or "vertex" or "groq"
        SDK->>SDK: Set structuredOutputs: true
    end

    SDK->>VercelSDK: Initialize model with providerOptions
    VercelSDK-->>SDK: Model Instance

    Note over App, Anthropic: Runtime Request Flow

    App->>SDK: request(prompt, schema)
    SDK->>VercelSDK: generateObject / generateText
    
    VercelSDK->>Anthropic: POST /v1/messages
    Note right of VercelSDK: Request payload no longer includes<br/>unsupported 'structured_output_mode'
    
    Anthropic-->>VercelSDK: LLM Response (JSON/Text)
    VercelSDK-->>SDK: Parsed Result
    SDK-->>App: Typed Response
Loading

@tkattkat tkattkat merged commit a500de1 into main Apr 22, 2026
205 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 22, 2026
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.

2 participants