[FEATURE] Support default variant configuration per agent (#7156) #4331

Open
opened 2026-02-16 17:43:27 -05:00 by yindo · 7 comments
Owner

Originally created by @CasualDeveloper on GitHub (Jan 6, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Allow users to configure a default variant for each agent, so models with thinking/reasoning variants automatically use the configured level without requiring --variant flag or ctrl+t cycling.

Motivation

Currently, users can only select variants via:

  • --variant high CLI flag
  • ctrl+t keybind to cycle variants in TUI

This means:

  1. Users must manually select variants every time
  2. Subagents cannot use variants at all (Task tool doesn't pass variant)
  3. Users cannot set different thinking levels for different agents (e.g., oracle with high thinking, explore with low)

Related: NoeFabris/opencode-antigravity-auth#125

Proposed Solution

Add a variant field to the agent configuration:

{
  "agent": {
    "build": {
      "model": "google/antigravity-claude-sonnet-4-5-thinking",
      "variant": "high"
    },
    "explore": {
      "model": "google/antigravity-gemini-3-flash",
      "variant": "low"
    }
  }
}

Variant Priority Order

  1. Explicit user selection (--variant flag or ctrl+t)
  2. Agent's configured default variant
  3. None (model's base behavior)

Subagent Behavior

Subagents use their own configured agent.variant rather than inheriting the parent's --variant override. This respects explicit per-agent configuration.

Implementation

  • Add variant field to Config.Agent schema
  • Add variant to Agent.Info type
  • Parse variant from config in agent state initialization
  • Use agent.variant as fallback in prompt.ts
  • Pass agent.variant to subagent sessions in task.ts
  • Use fallback logic in llm.ts variant resolution

Testing

  • Configure agent with variant: "high"
  • Verify model uses high variant without --variant flag
  • Verify --variant low overrides agent config
  • Verify subagents use their own variant config
Originally created by @CasualDeveloper on GitHub (Jan 6, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Allow users to configure a default variant for each agent, so models with thinking/reasoning variants automatically use the configured level without requiring `--variant` flag or `ctrl+t` cycling. ## Motivation Currently, users can only select variants via: - `--variant high` CLI flag - `ctrl+t` keybind to cycle variants in TUI This means: 1. Users must manually select variants every time 2. Subagents cannot use variants at all (Task tool doesn't pass variant) 3. Users cannot set different thinking levels for different agents (e.g., oracle with high thinking, explore with low) Related: NoeFabris/opencode-antigravity-auth#125 ## Proposed Solution Add a `variant` field to the agent configuration: ```json { "agent": { "build": { "model": "google/antigravity-claude-sonnet-4-5-thinking", "variant": "high" }, "explore": { "model": "google/antigravity-gemini-3-flash", "variant": "low" } } } ``` ### Variant Priority Order 1. Explicit user selection (`--variant` flag or `ctrl+t`) 2. Agent's configured default variant 3. None (model's base behavior) ### Subagent Behavior Subagents use their own configured `agent.variant` rather than inheriting the parent's `--variant` override. This respects explicit per-agent configuration. ## Implementation - [x] Add `variant` field to `Config.Agent` schema - [x] Add `variant` to `Agent.Info` type - [x] Parse variant from config in agent state initialization - [x] Use `agent.variant` as fallback in `prompt.ts` - [x] Pass `agent.variant` to subagent sessions in `task.ts` - [x] Use fallback logic in `llm.ts` variant resolution ## Testing - Configure agent with `variant: "high"` - Verify model uses high variant without `--variant` flag - Verify `--variant low` overrides agent config - Verify subagents use their own variant config
Author
Owner

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

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

  • #6645: [FEATURE]: Support for Model Variants in (sub)agents - discusses specifying model variants per agent
  • #6928: Subtask commands do not inherit model - related to agent-specific model configuration
  • #6558: [FEATURE]: give task/subagent an optional config to choose what model it runs on - discusses agent-level model configuration
  • #6651: [FEATURE]: Dynamic model selection for subagents via Task tool - comprehensive proposal for agent-specific model tier configuration

Feel free to ignore if these don't address your specific variant configuration use case.

@github-actions[bot] commented on GitHub (Jan 6, 2026): This issue might be a duplicate of existing issues. Please check: - #6645: [FEATURE]: Support for Model Variants in (sub)agents - discusses specifying model variants per agent - #6928: Subtask commands do not inherit model - related to agent-specific model configuration - #6558: [FEATURE]: give task/subagent an optional config to choose what model it runs on - discusses agent-level model configuration - #6651: [FEATURE]: Dynamic model selection for subagents via Task tool - comprehensive proposal for agent-specific model tier configuration Feel free to ignore if these don't address your specific variant configuration use case.
Author
Owner

@rekram1-node commented on GitHub (Jan 6, 2026):

/oc add this feature, make sure u update necessary files in agent/agent.ts and config/config.ts, there may be others too

@rekram1-node commented on GitHub (Jan 6, 2026): /oc add this feature, make sure u update necessary files in agent/agent.ts and config/config.ts, there may be others too
Author
Owner

@opencode-agent[bot] commented on GitHub (Jan 6, 2026):

Created PR #7140

New%20session%20-%202026-01-06T23%3A49%3A15.558Z
opencode session  |  github run

@opencode-agent[bot] commented on GitHub (Jan 6, 2026): Created PR #7140 <a href="https://opencode.ai/s/FsneaBxl"><img width="200" alt="New%20session%20-%202026-01-06T23%3A49%3A15.558Z" src="https://social-cards.sst.dev/opencode-share/TmV3IHNlc3Npb24gLSAyMDI2LTAxLTA2VDIzOjQ5OjE1LjU1OFo=.png?model=opencode/claude-opus-4-5&version=1.1.4&id=FsneaBxl" /></a> [opencode session](https://opencode.ai/s/FsneaBxl)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/anomalyco/opencode/actions/runs/20765737082)
Author
Owner

@chindris-mihai-alexandru commented on GitHub (Jan 20, 2026):

This would be really helpful! I use Antigravity (free Claude/Gemini via Vertex AI) for my primary agent and Cerebras for fast subagents. Right now I have to ctrl+t every session to get thinking mode, and subagents can't use variants at all.

With per-agent variants, I could set variant: "high" on my primary and variant: "max" on security-auditor while keeping fast subagents variant-free.

@chindris-mihai-alexandru commented on GitHub (Jan 20, 2026): This would be really helpful! I use Antigravity (free Claude/Gemini via Vertex AI) for my primary agent and Cerebras for fast subagents. Right now I have to `ctrl+t` every session to get thinking mode, and subagents can't use variants at all. With per-agent variants, I could set `variant: "high"` on my primary and `variant: "max"` on security-auditor while keeping fast subagents variant-free.
Author
Owner

@deepfriedmind commented on GitHub (Feb 6, 2026):

Has this already been added to the schema even though it's not implemented yet?

Image
@deepfriedmind commented on GitHub (Feb 6, 2026): Has this already been added to the schema even though it's not implemented yet? <img width="1340" height="300" alt="Image" src="https://github.com/user-attachments/assets/72b3f3f4-1f5d-41c0-b459-d0defba7447c" />
Author
Owner

@mjakl commented on GitHub (Feb 6, 2026):

@deepfriedmind This has been there for some time, but it didn't work as one might expect. The sub-agents inherited the variant from the main agent, no matter what variant was configured.

@mjakl commented on GitHub (Feb 6, 2026): @deepfriedmind This has been there for some time, but it didn't work as one might expect. The sub-agents inherited the variant from the main agent, no matter what variant was configured.
Author
Owner

@mugnimaestra commented on GitHub (Feb 7, 2026):

For anyone following this — PR #12567 adds the dynamic counterpart to the static agent config in #7156. When no agent-level variant is set, the subagent now inherits the parent session's variant at spawn time. With both PRs, the resolution order becomes: user input → agent config (#7156) → parent variant (#12567) → model default. They're independent and merge cleanly.

@mugnimaestra commented on GitHub (Feb 7, 2026): For anyone following this — PR #12567 adds the dynamic counterpart to the static agent config in #7156. When no agent-level variant is set, the subagent now inherits the parent session's variant at spawn time. With both PRs, the resolution order becomes: **user input → agent config (#7156) → parent variant (#12567) → model default**. They're independent and merge cleanly.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4331