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
[Question]: How does oh-my-opencode map the 'max' variant for native Anthropic provider models like claude-opus-4-6? #2630
I have searched for similar issues before creating this one
I am using the latest version of oh-my-opencode
I have read the documentation and README
Question
When using anthropic/claude-opus-4-6 with "variant": "max" in the oh-my-opencode agent config (e.g., for Sisyphus), the Anthropic API returns HTTP 400 invalid_request_error.
Looking at the OpenCode logs, the actual request body sent to https://api.anthropic.com/v1/messages includes:
This was working fine on 2026-03-16 and started failing on 2026-03-17, with identical OpenCode version (1.2.27), oh-my-opencode config, and plugin versions ([email protected]). No config changes were made between the working and broken states.
My questions:
Is the "max" variant mapping for native Anthropic provider models handled by oh-my-opencode, or is it delegated entirely to OpenCode's built-in @ai-sdk/anthropic provider?
If oh-my-opencode is responsible, how does it translate "variant": "max" into API parameters for the Anthropic provider? The Antigravity proxy models have explicit thinkingConfig.thinkingBudget mappings in opencode.json, but the native Anthropic provider doesn't seem to have equivalent definitions.
Is there a recommended workaround — e.g., defining explicit variant mappings in opencode.json for anthropic/claude-opus-4-6?
The same "variant": "max" works correctly when used with Antigravity proxy models (e.g., antigravity-claude-opus-4-5-thinking) because those have explicit variant definitions in opencode.json:
How oh-my-opencode maps the "max" variant for Anthropic models
1. Variant Resolution Chain
oh-my-opencode determines the variant through this priority order:
Agent override: agents.{name}.variant in your config
Category override: categories.{category}.variant if agent has category set
Fallback chain defaults: From AGENT_MODEL_REQUIREMENTS (hardcoded per agent)
For sisyphus + anthropic/claude-opus-4-6, the fallback chain specifies variant: "max":
// src/shared/model-requirements.ts
sisyphus: {fallbackChain: [{providers: ["anthropic","github-copilot","opencode"],model: "claude-opus-4-6",variant: "max",// <-- Default variant for this model},// ...]}
2. What oh-my-opencode does with "max" variant
The anthropic-effort hook (src/hooks/anthropic-effort/hook.ts) handles the translation:
if(message.variant!=="max")returnif(!isClaudeProvider(model.providerID,model.modelID))returnif(!isOpus46(model.modelID))returnif(output.options.effort!==undefined)returnoutput.options.effort="max"// <-- Injected into chat.params
oh-my-opencode ONLY injects output.options.effort = "max". Nothing else.
3. The actual problem: OpenCode's parameter mapping
The invalid parameters you're seeing (thinking.type: "adaptive" and output_config.effort) are NOT coming from oh-my-opencode. These are being added by OpenCode's built-in Anthropic provider (@ai-sdk/anthropic) when it processes the effort: "max" option.
The fact that it broke on 2026-03-17 with identical versions suggests OpenCode's server-side or the AI SDK's handling of the effort option changed.
4. Workarounds
Option A: Override variant in your config
{
"agents": {
"sisyphus": {
"model": "anthropic/claude-opus-4-6",
"variant": "high"// Use "high" instead of "max"
}
}
}
Option B: Use a proxy provider
Antigravity proxy models have explicit thinkingConfig mappings that work correctly:
Option C: Wait for fix
This is an upstream OpenCode/AI SDK issue. The effort parameter mapping for Anthropic native provider needs to be fixed on their end.
Summary
Question
Answer
Who handles "max" variant mapping?
oh-my-opencode injects effort: "max" via chat.params hook
Activity
code-yeongyu commentedon Mar 24, 2026
[sisyphus-bot]
How oh-my-opencode maps the "max" variant for Anthropic models
1. Variant Resolution Chain
oh-my-opencode determines the variant through this priority order:
agents.{name}.variantin your configcategories.{category}.variantif agent hascategorysetAGENT_MODEL_REQUIREMENTS(hardcoded per agent)For
sisyphus+anthropic/claude-opus-4-6, the fallback chain specifiesvariant: "max":2. What oh-my-opencode does with "max" variant
The
anthropic-efforthook (src/hooks/anthropic-effort/hook.ts) handles the translation:oh-my-opencode ONLY injects
output.options.effort = "max". Nothing else.3. The actual problem: OpenCode's parameter mapping
The invalid parameters you're seeing (
thinking.type: "adaptive"andoutput_config.effort) are NOT coming from oh-my-opencode. These are being added by OpenCode's built-in Anthropic provider (@ai-sdk/anthropic) when it processes theeffort: "max"option.The fact that it broke on 2026-03-17 with identical versions suggests OpenCode's server-side or the AI SDK's handling of the
effortoption changed.4. Workarounds
Option A: Override variant in your config
{ "agents": { "sisyphus": { "model": "anthropic/claude-opus-4-6", "variant": "high" // Use "high" instead of "max" } } }Option B: Use a proxy provider
Antigravity proxy models have explicit
thinkingConfigmappings that work correctly:{ "agents": { "sisyphus": { "model": "antigravity-claude-opus-4-5-thinking" } } }Option C: Wait for fix
This is an upstream OpenCode/AI SDK issue. The
effortparameter mapping for Anthropic native provider needs to be fixed on their end.Summary
effort: "max"viachat.paramshookvariant: "high"or switch to antigrathy proxy