Skip to content

[Question]: How does oh-my-opencode map the 'max' variant for native Anthropic provider models like claude-opus-4-6? #2630

Closed

Description

@cyberprophet

Prerequisites

  • I am writing this issue in English
  • 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:

{
  "model": "claude-opus-4-6",
  "max_tokens": 32000,
  "thinking": {"type": "adaptive"},
  "output_config": {"effort": "max"}
}

Neither thinking.type: "adaptive" nor output_config.effort appear to be valid Anthropic Messages API parameters. The API response is:

{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Error"
  }
}

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:

  1. 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?
  2. 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.
  3. Is there a recommended workaround — e.g., defining explicit variant mappings in opencode.json for anthropic/claude-opus-4-6?

Question Category

Configuration

Context

oh-my-opencode config (oh-my-opencode.json):

{
  "agents": {
    "sisyphus": {
      "model": "anthropic/claude-opus-4-6",
      "variant": "max"
    }
  },
  "categories": {
    "unspecified-high": {
      "model": "anthropic/claude-opus-4-6",
      "variant": "max"
    }
  }
}

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:

"antigravity-claude-opus-4-5-thinking": {
  "variants": {
    "max": {
      "thinkingConfig": {
        "thinkingBudget": 32768
      }
    }
  }
}

Doctor Output

 oMoMoMoMo Doctor 

 ✓ System OK (opencode 1.2.27 · oh-my-opencode unknown)

Additional Information

  • OS: macOS (Darwin 25.3.0)
  • OpenCode version: 1.2.27
  • Error log: AI_APICallError with statusCode: 400, isRetryable: false

Activity

  1. code-yeongyu commented on Mar 24, 2026

    @code-yeongyu
    Owner

    [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:

    1. Agent override: agents.{name}.variant in your config
    2. Category override: categories.{category}.variant if agent has category set
    3. 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") return
    if (!isClaudeProvider(model.providerID, model.modelID)) return
    if (!isOpus46(model.modelID)) return
    if (output.options.effort !== undefined) return
    
    output.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:

    {
      "agents": {
        "sisyphus": {
          "model": "antigravity-claude-opus-4-5-thinking"
        }
      }
    }

    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
    Who adds the invalid API parameters? OpenCode's Anthropic provider (AI SDK)
    Is there an oh-my-opencode fix? No — the issue is upstream parameter translation
    Recommended workaround? Use variant: "high" or switch to antigrathy proxy
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