Skip to content

feat(v2): allow disabling Anthropic thinking block binding - #48793

Open
DEAN-Cherry wants to merge 2 commits into
anomalyco:v2from
DEAN-Cherry:fix/v2-thinking-block-binding-opt-out-pr
Open

DEAN-Cherry wants to merge 2 commits into
anomalyco:v2from
DEAN-Cherry:fix/v2-thinking-block-binding-opt-out-pr

Conversation

@DEAN-Cherry

Copy link
Copy Markdown

Issue for this PR

Fixes #48757

Type of change

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

What does this PR do?

OpenCode V2 automatically adds Anthropic thinking block binding for Claude 5.1+ models. Some Anthropic-compatible endpoints reject thinking.block_binding entirely.

This exposes an opt-out in V2 and supports the V1-compatible model configuration:

{
  "provider": {
    "anthropic": {
      "models": {
        "claude-opus-5": {
          "options": {
            "thinking": {
              "type": "adaptive",
              "blockBinding": false
            }
          }
        }
      }
    }
  }
}

V2 consumes blockBinding: false before serializing the Anthropic request. The resulting request omits thinking.block_binding and the thinking-binding-controls-2026-08-01 beta header. When the option is absent, the existing model-ID-based default remains unchanged.

How did you verify your code works?

  • AI Anthropic binding tests: 15 passed
  • Schema model tests: 7 passed
  • Core provider tests: 19 passed
  • V1-to-V2 migration opt-out test passed
  • AI, schema, and core typechecks passed

Screenshots / recordings

Not applicable; this is a non-UI change.

Checklist

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

This branch has not been deployed

No deployments
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