[PR #7907] feat: add variant support for commands (#7713) #12562

Open
opened 2026-02-16 18:17:28 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7907

State: open
Merged: No


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.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7907 **State:** open **Merged:** No --- ### 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.
yindo added the pull-request label 2026-02-16 18:17:28 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12562