Skip to content

Beta header rewrite breaks Opus 5.5, Sonnet 5.5 and Fable 5.1 on OpenCode 1.18.x #33

Description

@balaji-dutt

On AI assistance: Claude (Opus 5.5 / 1M context) helped me narrow down the behavior and draft the wording below, including the repro steps. The actual issue and workflow are mine. — @balaji-dutt

Summary

With opencode 1.18.31 and opencode-claude-bridge 1.10.12, every request to a Claude 5.1+ model through the anthropic provider fails:

thinking.adaptive.block_binding: Extra inputs are not permitted

Since anomalyco/opencode#46653 (scoped to 5.1+ by anomalyco/opencode#46848), opencode adds thinking.block_binding to these requests and sends the thinking-binding-controls-2026-08-01 beta with it. buildBetaFlags() ignores the incoming anthropic-beta value and replaces it with BETA_FLAGS, so the field reaches the API without its beta.

#32 fixes this by merging the incoming flags. I'm filing this so the error is searchable, and to ask for #32 to be merged and released.

Affected models

Reproduced 2026-10-02 on macOS arm64, opencode 1.18.31 (Homebrew), bridge 1.10.12 (npm):

Model Result
anthropic/claude-opus-5-5 400, error above
anthropic/claude-sonnet-5-5 400, error above
anthropic/claude-fable-5-1 400, error above
anthropic/claude-opus-5 OK (opencode sends no binding below 5.1)

Repro:

opencode run -m anthropic/claude-opus-5-5 'Reply with exactly: OK'

Confirming the cause

Adding the beta to the bridge's own list makes the same request succeed over OAuth, so the subscription path accepts it once it survives the rewrite:

ANTHROPIC_BETA_FLAGS="interleaved-thinking-2025-05-14,thinking-token-count-2026-05-13,context-management-2025-06-27,prompt-caching-scope-2026-01-05,claude-code-20250219,advisor-tool-2026-03-01,effort-2025-11-24,extended-cache-ttl-2025-04-11,thinking-binding-controls-2026-08-01" \
  opencode run -m anthropic/claude-opus-5-5 'Reply with exactly: OK'
# OK

Workaround

The per-model opt-out from anomalyco/opencode#46820, repeated for each 5.1+ model:

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

Keep type: "adaptive". Without it, opencode drops the thinking object, and THINKING_MODELS only re-adds thinking for 4.x models, so the request goes out with no thinking at all.

Ask

Please merge and release #32. A release would also ship the #19 loader fix from #27: npm latest is still 1.10.12 (2026-07-02), and on 1.18.31 every start still logs failed to load plugin ... modelId.match is not a function. The request rewriting still runs despite that error; the ANTHROPIC_BETA_FLAGS test above changes the outcome.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions