Skip to content

fix(provider): scope thinking binding to Claude 5.1+ - #46848

Merged
rekram1-node merged 1 commit into
devfrom
thinking-binding-scope
Sep 2, 2026
Merged

fix(provider): scope thinking binding to Claude 5.1+#46848
rekram1-node merged 1 commit into
devfrom
thinking-binding-scope

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Issue for this PR

Fixes #46729
Fixes #46777

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Stop automatically adding thinking block binding to Claude 4.x and 5.0 requests. Those models do not need the prefix-mismatch control, and some deployments reject it. This also affects Haiku 4.5 title generation even when the main Opus 5 request succeeds.

Use Claude 5.1+ as the forward-compatible default, with an explicit exception for Mythos 5.1. Anthropic documents enforcement on Fable 5.1 and later models, and says Mythos 5.1 does not run the conversation-prefix check: https://platform.claude.com/docs/en/build-with-claude/thinking#preserved-in-conversation

The numeric cutoff is our forward-compatibility policy, not a claim that every future cloud deployment has been verified. Match API model IDs, including Bedrock prefixes, Vertex suffixes, and either family/version order. Preserve existing thinking settings on excluded models and keep binding protection on eligible models.

No opt-out, SDK upgrade, retry change, or API routing change.

How did you verify your code works?

Run from packages/opencode:

  • bun test test/provider/transform.test.ts test/provider/amazon-bedrock.test.ts --only-failures — 576 pass
  • bun typecheck — passes
  • Prettier check — passes

The new regression cases failed before the implementation change. Coverage includes future versions, the Mythos exception, and SDK request bodies/betas for Opus 5, Sonnet 5, and Haiku title generation across Anthropic, Vertex, and Bedrock. Existing Fable 5.1 wire tests still pass.

These are captured-request tests, not new live-provider verification.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@rekram1-node
rekram1-node merged commit 9a71624 into dev Sep 2, 2026
10 checks passed
@rekram1-node
rekram1-node deleted the thinking-binding-scope branch September 2, 2026 16:30
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 2026
filipeforattini added a commit to reddb-io/redcode that referenced this pull request Sep 5, 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

1 participant