You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Anthropic provider sends invalid API parameters (thinking.type: adaptive, output_config.effort) when variant is set #17876
When using the native Anthropic provider with claude-opus-4-6 and a "max" variant (configured via oh-my-opencode plugin), OpenCode's bundled @ai-sdk/anthropic provider generates invalid request parameters, causing the Anthropic API to return HTTP 400 invalid_request_error.
The request body sent to https://api.anthropic.com/v1/messages includes:
This was working on 2026-03-16 and broke on 2026-03-17 with no changes to OpenCode version, config, or plugins. This suggests either a server-side Anthropic API validation change, or an issue in how OpenCode's @ai-sdk/anthropic bundle maps variant options to Anthropic API parameters.
Plugins
oh-my-opencode (sets "variant": "max" on agent configs), [email protected]
OpenCode Version
1.2.27
Steps to Reproduce
Configure an agent with "model": "anthropic/claude-opus-4-6" and "variant": "max" (via oh-my-opencode or directly)
Start a session and send any message
OpenCode attempts to call https://api.anthropic.com/v1/messages with the invalid parameters
API returns 400 invalid_request_error
Operating System
macOS (Darwin 25.3.0)
Additional Context
From the logs:
service=provider providerID=anthropic pkg=@ai-sdk/anthropic using bundled provider
ERROR service=session.processor error=Error stack="AI_APICallError: Error\n at <anonymous> (/$bunfs/root/src/index.js:101905:30)"
Key observation: Custom provider models defined in opencode.json with explicit variant mappings (e.g., Antigravity proxy models using thinkingConfig.thinkingBudget) work correctly. The issue is specifically with the built-in Anthropic provider interpreting the variant and producing non-standard API parameters.
Workaround: Removing the "variant": "max" from the model config allows claude-opus-4-6 to work without extended thinking.
This issue might be a duplicate of existing issues. Please check:
Support adaptive thinking for Claude Opus 4.6 #12485: Feature request to support adaptive thinking for Claude Opus 4.6 — describes the same thinking.type: adaptive + output_config.effort parameters and notes that @ai-sdk/anthropic support upstream is a dependency
Thanks for flagging the duplicates. After reviewing:
Support adaptive thinking for Claude Opus 4.6 #12485 covers exactly this scenario — @ai-sdk/anthropic doesn't yet support the new thinking.type: "adaptive" + output_config.effort parameters that Opus 4.6 requires, so the request reaches the API malformed.
Activity
github-actions commentedon Mar 17, 2026
This issue might be a duplicate of existing issues. Please check:
thinking.type: adaptive+output_config.effortparameters and notes that@ai-sdk/anthropicsupport upstream is a dependencymaxsending invalid parameters to non-Opus models, causing 400 errors from the Anthropic APIcyberprophet commentedon Mar 17, 2026
Thanks for flagging the duplicates. After reviewing:
@ai-sdk/anthropicdoesn't yet support the newthinking.type: "adaptive"+output_config.effortparameters that Opus 4.6 requires, so the request reaches the API malformed.Closing as duplicate of #12485. Will track progress there.