[FEATURE]: Commands Model Variant Specification #4680

Open
opened 2026-02-16 17:45:01 -05:00 by yindo · 3 comments
Owner

Originally created by @koichincom on GitHub (Jan 10, 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

I'm willing to implement this, but since it involves some design decisions, I wanted to open an issue first.

Summary

Add a variant field to the commands feature. Currently, command definitions in command/*.md or opencode.json(c) only allow selecting the model or agent, but not the model variant.

Motivation

While variants can be applied globally or per-agent, it is useful to bake specific reasoning efforts into commands. For example, a command designed for complex planning or code review might always want to use a high thinking variant of a lightweight model, even if the user's global preference is set to minimal. This ensures specific tasks have the reasoning budget they need without requiring the user to manually switch variants before running the command.

The precedence has been reconsidered. Check #7907

Proposed Priority

If implemented, I suggest the following priority for variant resolution:

  1. Explicit runtime selection (CLI --variant flag or TUI ctrl+t)
  2. Command definition variant (The new field)
  3. Agent default variant (as implemented in #7140)
  4. None (Model default)
Originally created by @koichincom on GitHub (Jan 10, 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 I'm willing to implement this, but since it involves some design decisions, I wanted to open an issue first. ## Summary Add a variant field to the commands feature. Currently, command definitions in command/*.md or opencode.json(c) only allow selecting the model or agent, but not the model variant. ## Motivation While variants can be applied globally or per-agent, it is useful to bake specific reasoning efforts into commands. For example, a command designed for complex planning or code review might always want to use a high thinking variant of a lightweight model, even if the user's global preference is set to minimal. This ensures specific tasks have the reasoning budget they need without requiring the user to manually switch variants before running the command. The precedence has been reconsidered. Check #7907 <s> ## Proposed Priority If implemented, I suggest the following priority for variant resolution: 1. Explicit runtime selection (CLI --variant flag or TUI ctrl+t) 2. Command definition variant (The new field) 3. Agent default variant (as implemented in #7140) 4. None (Model default) </s>
yindo added the discussion label 2026-02-16 17:45:01 -05:00
Author
Owner

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

This feature request is related to several existing issues that address variant and model configuration:

  • #7138: Support default variant configuration per agent - Implements agent-level variant defaults, which is part of the variant resolution priority chain mentioned in this issue
  • #7354: Add --variant flag to root opencode command - Related to variant handling via CLI
  • #5082: Allow shell commands in the frontmatter - Related request for dynamic configuration in command definitions
  • #7099: Server API ignores agent's configured model when only agent parameter is passed - Related to model/agent configuration propagation
  • #7407: Allow skills and commands to define scoped permission overrides - Shows precedent for adding configuration fields to command frontmatter

You may want to cross-reference these issues, particularly #7138 which implements the agent-level variant configuration that would complement your proposed command-level variant specification.

@github-actions[bot] commented on GitHub (Jan 10, 2026): This feature request is related to several existing issues that address variant and model configuration: - #7138: Support default variant configuration per agent - Implements agent-level variant defaults, which is part of the variant resolution priority chain mentioned in this issue - #7354: Add `--variant` flag to root `opencode` command - Related to variant handling via CLI - #5082: Allow shell commands in the frontmatter - Related request for dynamic configuration in command definitions - #7099: Server API ignores agent's configured model when only agent parameter is passed - Related to model/agent configuration propagation - #7407: Allow skills and commands to define scoped permission overrides - Shows precedent for adding configuration fields to command frontmatter You may want to cross-reference these issues, particularly #7138 which implements the agent-level variant configuration that would complement your proposed command-level variant specification.
Author
Owner

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

@koichincom Nakayamada-san, this is similar to what I was interested in with my issue #7138 / pr #7156 for variant support in agents - try taking a look and see if maybe commands can be extended similarly :P

@CasualDeveloper commented on GitHub (Jan 11, 2026): @koichincom Nakayamada-san, this is similar to what I was interested in with my issue #7138 / pr #7156 for variant support in agents - try taking a look and see if maybe commands can be extended similarly :P
Author
Owner

@koichincom commented on GitHub (Jan 11, 2026):

@koichincom Nakayamada-san, this is similar to what I was interested in with my issue #7138 / pr #7156 for variant support in agents - try taking a look and see if maybe commands can be extended similarly :P

@CasualDeveloper Thanks! I'll look into it and probably make a PR for the commands feature!

@koichincom commented on GitHub (Jan 11, 2026): > @koichincom Nakayamada-san, this is similar to what I was interested in with my issue #7138 / pr #7156 for variant support in agents - try taking a look and see if maybe commands can be extended similarly :P @CasualDeveloper Thanks! I'll look into it and probably make a PR for the commands feature!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4680