opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: add variant support for commands (#7713)

Open koichincom opened this issue 3 days ago • 2 comments

What does this PR do?

Fixes #7713 by the following:

  • Adds a variant field to the commands configuration.
  • Variant needs to be specified with the model (throws an error if not)
  • Invalid variant names show a help message and throw an error (no fuzzy search)

How did you verify your code works?

  • Added model and variant fields to the existing packages/opencode/test/config/config.test.ts for config parsing.
  • Performed three manual tests by creating an opencode.json in the root:
    • Valid: model and variant are specified (used a temporary toast to verify the variant change).
    • Without variant: only the model is specified.
    • Invalid variant: an invalid variant name was used.

Consideration

When #7156 or #7140 lands, its model-default variant feature might need to be integrated.

koichincom avatar Jan 12 '26 03:01 koichincom