Skip to content

fix(core): detect Bedrock Anthropic model IDs - #2682

Open
uuzzrm wants to merge 1 commit into
browserbase:v3from
uuzzrm:codex/fix-bedrock-anthropic-provider
Open

fix(core): detect Bedrock Anthropic model IDs#2682
uuzzrm wants to merge 1 commit into
browserbase:v3from
uuzzrm:codex/fix-bedrock-anthropic-provider

Conversation

@uuzzrm

@uuzzrm uuzzrm commented Aug 10, 2026

Copy link
Copy Markdown

Fixes #2565

AISdkClient infers provider-specific options from the model ID. AWS Bedrock Anthropic IDs use anthropic.<model> or region.anthropic.<model>, so they do not match the existing provider/model format and miss Anthropic's structuredOutputMode: "auto" option.

This change:

  • recognizes raw and cross-region Bedrock Anthropic model IDs
  • leaves the existing slash-separated and legacy model ID behavior unchanged
  • adds regression coverage for both Bedrock ID shapes
  • includes a patch changeset for @browserbasehq/stagehand

Verification:

  • Prettier check passed
  • ESLint passed for the changed TypeScript files
  • TypeScript typecheck passed
  • ESM and CJS builds passed
  • Focused Vitest suite passed (12 tests)

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 225ba80

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

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

@uuzzrm

uuzzrm commented Aug 10, 2026

Copy link
Copy Markdown
Author

Local verification is complete: the core build, lint, typecheck, and focused Bedrock regression tests pass. The GitHub Actions runs currently show action_required with no jobs, so they appear to be waiting for maintainer approval for fork workflow runs. I will address any CI feedback once the workflows start.

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

Copy link
Copy Markdown
Contributor

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 Client as AI SDK Client
    participant Infer as inferProviderName()
    participant OptMap as ProviderOptionMap

    Client->>Infer: modelId (e.g. "us.anthropic.claude-sonnet-4-6[1m]")
    Infer->>Infer: const [providerName] = modelId.split("/")

    alt modelId contains "/" (standard provider/model)
        Infer-->>Client: return providerName (e.g. "openai")
    else no "/" present
        alt regex matches /^(?:[a-z0-9-]+\.)?anthropic\./i
            Infer-->>Client: NEW: return "anthropic" (Bedrock style)
        else no match (legacy bare model ID)
            Infer-->>Client: return providerName (original value)
        end
    end

    Client->>OptMap: get provider options for "anthropic"
    OptMap-->>Client: anthropic: { structuredOutputMode: "auto" }

    Note over Client,OptMap: Provider-specific structured output options are now applied for Bedrock Anthropic model IDs.
Loading

Re-trigger cubic

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.

1 participant