opencode
opencode copied to clipboard
feat: add variant support for commands (#7713)
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.tsfor config parsing. - Performed three manual tests by creating an
opencode.jsonin 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.