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
Support adaptive thinking for Claude Opus 4.6 #12485
Anthropic has deprecated thinking.type: "enabled" with budget_tokens on Opus 4.6 and will remove it in a future release. The recommended replacement is adaptive thinking:
OpenCode currently depends on @ai-sdk/anthropic v2.x. Simply bumping the dependency to v3.x and rebuilding isn't enough — there are several breaking changes in the SDK that need to be addressed in the codebase.
Below is a summary of every breaking change identified so far, tried different fixes in my codebase but that's a lot of work.
usage: {inputTokens: {total: 1234,noCache: 1034,cacheRead: 200},outputTokens: {total: 567,text: undefined},reasoningTokens: 200,// may also be an object}
3. New providerOptions schema (thinking / effort)
v2.x supports a limited thinking config:
thinking: {type: "enabled"|"disabled",budgetTokens?: number,}// No "effort" field
v3.x adds an adaptive mode and a new top-level effort field:
thinking: {type: "adaptive"|"enabled"|"disabled",budgetTokens?: number,// only required when type is "enabled"}
effort: "low"|"medium"|"high"|"max"// NEW
Fix
Update config schema validation (e.g. Zod schemas or type definitions) to accept the new "adaptive" type and the effort field.
Problem is that we probably need to update all ai-sdk to last version for compatibility across models
Activity
BouquetAntoine commentedon Feb 6, 2026
OpenCode currently depends on
@ai-sdk/anthropicv2.x. Simply bumping the dependency to v3.x and rebuilding isn't enough — there are several breaking changes in the SDK that need to be addressed in the codebase.Below is a summary of every breaking change identified so far, tried different fixes in my codebase but that's a lot of work.
1.
finishReasonformat changev2.x returns a plain string:
v3.x returns an object with
unifiedandrawproperties:2.
usagetoken counts format changev2.x returns flat numbers:
v3.x returns nested objects:
3. New
providerOptionsschema (thinking / effort)v2.x supports a limited thinking config:
v3.x adds an adaptive mode and a new top-level
effortfield:Fix
Update config schema validation (e.g. Zod schemas or type definitions) to accept the new
"adaptive"type and theeffortfield.Problem is that we probably need to update all ai-sdk to last version for compatibility across models
avarayr commentedon Feb 6, 2026
I was able to temporarily hack this to work until fix is in place.
Note: this is not a long term solution, just an unblocker until this issue is fixed.
BouquetAntoine commentedon Feb 6, 2026
#12342 will fix this soon
github-actions commentedon Apr 8, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.