Skip to content

fix(ai): guard Sonnet 5.5 Bedrock Converse requests - #52046

Closed
opencode-agent[bot] wants to merge 1 commit into
devfrom
sonnet55-bedrock-converse
Closed

opencode-agent[bot] wants to merge 1 commit into
devfrom
sonnet55-bedrock-converse

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Issue for this PR

Claude Sonnet 5.5 launched on September 28 with a Bedrock runtime Converse route. The existing Converse lowering could send forced tool choices, manual/disabled thinking, and non-default sampling, which the Anthropic migration guide says Sonnet 5.5 rejects. AWS's model card distinguishes runtime Converse from Mantle Messages (Mantle does not support Converse).

Type of change

  • Bug fix

What does this PR do?

  • Validate Sonnet 5.5 Converse's effective wire body after http.body overlays and return actionable InvalidRequest errors for forced tool choice, unsupported thinking settings, and non-default sampling instead of silently relaxing user intent or passing known-invalid requests to AWS.
  • Accept between_tools as a typed Sonnet 5.5 Bedrock thinking setting; don't append adaptive-thinking block binding when callers explicitly choose it. Guard its incompatible budget/binding/display and xhigh/max-effort combinations.
  • Keep older Claude and other Bedrock Converse models' lowering unchanged. This is separate from fix(ai): enable thinking binding recovery on Bedrock #51486's thinking-history recovery and fix(ai): support Sonnet 5.5 Messages request shapes #52045's Anthropic Messages route.

How did you verify your code works?

  • Test-first, 231 passing focused Bedrock Converse tests (including new request rejection, valid fallback, and actual HTTP wire-body cases); 7 passing Mantle tests with an unrelated ambient bearer-token variable excluded.
  • bun typecheck in packages/ai; scoped oxlint; Prettier; git diff --check all pass.
  • Root bun run check reaches typecheck but cannot complete here: the host's Node 18 is unsupported by Astro in @opencode/posts. The affected package checks above pass.

Screenshots / recordings

Not a UI change.

Requested by: @nexxeln (nexxel via Slack)

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant