Skip to content

feat: Support default variant configuration per agent #7138

@CasualDeveloper

Description

@CasualDeveloper

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions