⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@CasualDeveloper
Copy link
Contributor

@CasualDeveloper CasualDeveloper commented Jan 7, 2026

What does this PR do?

Adds agent-level default variant configuration, allowing users to set reasoning effort (e.g., "low", "medium", "high") per agent. This is an alternative to #7140 with broader scope: full desktop/web support, dynamic Task tool overrides, and TUI CLI parity.

Why this matters: Orchestrator agents can now spawn subagents with different model/variant combinations dynamically — no need to duplicate agent configs for each reasoning level.

Changes

Core backend

  • variant field in agent config schema
  • Resolution order: user input > agent config
  • Resolved variant stored in message metadata (not undefined when using agent default)
  • Subagents use their own configured variant, not inherited from parent

Task tool dynamic override (addresses @terwey's feedback on #7140)

  • Optional model and variant params added to Task tool schema
  • Priority: param override > agent config > parent context (model) / undefined (variant)

TUI

  • Effective variant displayed in prompt bar and agent picker
  • Added --variant CLI flag for parity with headless run command

Desktop/web app

  • Effective variant displayed in prompt bar and agent selector

SDK

  • Updated types.gen.ts and openapi.json

Comparison with #7140

Feature #7140 This PR
Core backend Yes Yes
TUI display Yes Yes
Desktop/web app No Yes
Message metadata undefined when agent default used Resolved variant stored
Task tool model/variant override No Yes
TUI --variant CLI flag No Yes
Files changed 9 18

Example usage

Agent config:

# .opencode/agent/oracle.md
---
model: anthropic/claude-sonnet-4
variant: "high"
---

Task tool override:

{
  "description": "Refactor auth module",
  "prompt": "Refactor the auth module to use OAuth2",
  "subagent_type": "implementer",
  "model": "anthropic/claude-sonnet-4-20250514",
  "variant": "low"
}

TUI CLI:

opencode --variant high

Closes #7138

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicates Found

PR #7140: Add default variant config per agent
#7140

Why related: This is the primary implementation that the current PR (#7156) is an alternative version of. According to the PR description, #7156 is an alternative implementation for #7138 that includes additional changes not present in #7140, specifically:

  • Fallback to agent.variant for message metadata in prompt.ts
  • Clarifying comment explaining subagent variant design choice in task.ts

The PR author explicitly states they're "happy to close this if #7140 incorporates these changes," indicating these are addressing the same feature with slightly different approaches.

@rekram1-node
Copy link
Collaborator

@CasualDeveloper we can do ur change if u want but I think ti requires updates to both tui AND desktop

@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch 3 times, most recently from 11edba0 to 9cc62c8 Compare January 8, 2026 05:59
@CasualDeveloper CasualDeveloper marked this pull request as ready for review January 8, 2026 05:59
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from 9cc62c8 to ae2dd3e Compare January 8, 2026 06:14
@CasualDeveloper
Copy link
Contributor Author

Thanks @rekram1-node! I've updated this PR to include both TUI and desktop support:

TUI: local.tsx, prompt/index.tsx, dialog-agent.tsx
Desktop: local.tsx, prompt-input.tsx

Both now have:

  • effective() method that returns current() ?? agent.current()?.variant
  • Variant display in prompt bar
  • Variant shown in agent selector

The prompt.ts change is backend-only and works for all clients automatically.

Ready for review when you have time!

@CasualDeveloper CasualDeveloper changed the title feat: add agent-level default variant support (alternative implementation) feat: add variant support for subagents #7138 (alt pr to #7140) Jan 8, 2026
@CasualDeveloper CasualDeveloper changed the title feat: add variant support for subagents #7138 (alt pr to #7140) feat: add variant support for subagents (#7138, alt pr to #7140) Jan 8, 2026
@CasualDeveloper CasualDeveloper changed the title feat: add variant support for subagents (#7138, alt pr to #7140) feat: add variant support for subagents (#7138) [alt of #7140] Jan 8, 2026
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch 5 times, most recently from 07c8bd5 to 065875f Compare January 11, 2026 14:31
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from 065875f to 6088a6f Compare January 11, 2026 18:51
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from 6088a6f to b6b1ad5 Compare January 12, 2026 07:43
- Add variant field to agent config schema
- Resolve variant with priority: user selection > agent config > none
- Display effective variant in TUI and desktop prompt bar
- Show variant in agent selector (TUI dialog + desktop dropdown)
- Subagents use their own configured variant (not inherited from parent)
- Store resolved variant in message metadata (prompt.ts)
- Add variant examples to triage and duplicate-pr agents
- Add model and variant override params to Task tool for dynamic control
- Orchestrator agents can now pass model/variant per task invocation
- Add --variant CLI flag to TUI command for parity with headless run

Closes anomalyco#7138
@CasualDeveloper CasualDeveloper force-pushed the feat/7138-agent-default-variant branch from b6b1ad5 to 1ddb904 Compare January 12, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Support default variant configuration per agent

2 participants