[FEATURE]: Support for Model Variants in (sub)agents #4088

Closed
opened 2026-02-16 17:42:34 -05:00 by yindo · 4 comments
Owner

Originally created by @Blankf on GitHub (Jan 2, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When having multiple variants of an model configured.
it would be good to have the agent config point to a specific model variant.

// Global Model Configuration
"anthropic/claude-sonnet-4-5": {
  "name": "anthropic/claude-sonnet-4-5",
  "variants": {
    "thinking": {
      "thinking": {
        "type": "enabled",
        "budget_tokens": 1600
      },
      "max_tokens": 2000
    },
    "fast": {
      "thinking": {
        "type": "disabled"
      }
    }
  }
}

would result in something like

---
description: Performs security audits and identifies vulnerabilities
mode: subagent
model: anthropic/claude-sonnet-4-5:fast
tools:
  write: false
  edit: false
---

You are a security expert. Focus on identifying potential security issues. 
Analyze the provided code and identify vulnerabilities such as SQL injection, 
XSS, or insecure dependency versions.

when i use a config with variants an did not specify any it takes the default model but that seems to prefer thinking.

it errors with

{"message":"The model returned the following errors: messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"}. Received Model Group=anthropic/claude-4-5-sonnet
Available Model Group Fallbacks=Non

when i use a simpel model config

    "anthropic/claude-4-5-sonnet": {
    	"name": "anthropic/claude-4-5-sonnet",
    	"options": {
    		"thinking": {
    			"type": "disabled"
    		}
    	}
    },
---
description: Performs security audits and identifies vulnerabilities
mode: subagent
tools:
  write: false
  edit: false
---

it does work! it takes that model and performs the actions as the security auditor.

Originally created by @Blankf on GitHub (Jan 2, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When having multiple variants of an model configured. it would be good to have the agent config point to a specific model variant. ```json // Global Model Configuration "anthropic/claude-sonnet-4-5": { "name": "anthropic/claude-sonnet-4-5", "variants": { "thinking": { "thinking": { "type": "enabled", "budget_tokens": 1600 }, "max_tokens": 2000 }, "fast": { "thinking": { "type": "disabled" } } } } ``` would result in something like ```markdown --- description: Performs security audits and identifies vulnerabilities mode: subagent model: anthropic/claude-sonnet-4-5:fast tools: write: false edit: false --- You are a security expert. Focus on identifying potential security issues. Analyze the provided code and identify vulnerabilities such as SQL injection, XSS, or insecure dependency versions. ``` when i use a config with variants an did not specify any it takes the default model but that seems to prefer thinking. it errors with ``` {"message":"The model returned the following errors: messages.1.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block (preceeding the lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"}. Received Model Group=anthropic/claude-4-5-sonnet Available Model Group Fallbacks=Non ``` when i use a simpel model config ```json "anthropic/claude-4-5-sonnet": { "name": "anthropic/claude-4-5-sonnet", "options": { "thinking": { "type": "disabled" } } }, ``` ```markdown --- description: Performs security audits and identifies vulnerabilities mode: subagent tools: write: false edit: false --- ``` it does work! it takes that model and performs the actions as the security auditor.
yindo added the discussion label 2026-02-16 17:42:34 -05:00
yindo closed this issue 2026-02-16 17:42:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 2, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #1106: Specifically asks about how to use Claude Sonnet with thinking mode, which is directly related to your feature request for model variants support
  • #3439: Feature request for custom model aliases, which could be an alternative approach to managing different model configurations

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 2, 2026): This issue might be a duplicate of existing issues. Please check: - #1106: Specifically asks about how to use Claude Sonnet with thinking mode, which is directly related to your feature request for model variants support - #3439: Feature request for custom model aliases, which could be an alternative approach to managing different model configurations Feel free to ignore if none of these address your specific case.
Author
Owner

@Blankf commented on GitHub (Jan 2, 2026):

it seems the id field is it, i missed that i guess.

@Blankf commented on GitHub (Jan 2, 2026): it seems the id field is it, i missed that i guess.
Author
Owner

@mjakl commented on GitHub (Jan 5, 2026):

@Blankf can you elaborate how the id field works to setup the variant? I'd also like to configure a model and a variant in my agent definition but couldn't figure out how to do that (without falling back to full model aliases).

@mjakl commented on GitHub (Jan 5, 2026): @Blankf can you elaborate how the `id` field works to setup the `variant`? I'd also like to configure a model and a variant in my agent definition but couldn't figure out how to do that (without falling back to full model aliases).
Author
Owner

@CasualDeveloper commented on GitHub (Jan 6, 2026):

For anyone following this issue - there's now an active effort to properly implement agent-level variant configuration:

Both PRs add a variant field to agent config:

{
  "agent": {
    "security-auditor": {
      "model": "anthropic/claude-sonnet-4-5",
      "variant": "fast"
    }
  }
}

This addresses the original request - you can now configure which variant each agent uses by default, without needing model aliases or the :variant suffix syntax.

The variant priority order is:

  1. Explicit user selection (--variant or ctrl+t)
  2. Agent's configured default variant
  3. None (model's base behavior)
@CasualDeveloper commented on GitHub (Jan 6, 2026): For anyone following this issue - there's now an active effort to properly implement agent-level variant configuration: - **Issue**: #7138 - **PR #7140**: Initial implementation - **PR #7156**: Alternative implementation with additional changes Both PRs add a `variant` field to agent config: ```json { "agent": { "security-auditor": { "model": "anthropic/claude-sonnet-4-5", "variant": "fast" } } } ``` This addresses the original request - you can now configure which variant each agent uses by default, without needing model aliases or the `:variant` suffix syntax. The variant priority order is: 1. Explicit user selection (`--variant` or `ctrl+t`) 2. Agent's configured default variant 3. None (model's base behavior)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4088