Uh oh!
There was an error while loading. Please reload this page.
feat: add variant support for commands (#7713) - #7907
Conversation
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
The following comment was made by an LLM, it may be inaccurate: I found related PRs that might be relevant to this variant support implementation: Related PRs (Not exact duplicates, but related features):
These are complementary features rather than direct duplicates. The current PR (#7907) specifically adds variant support for commands, while #7140 and #7156 address variant support for agents/subagents. They may need to be coordinated during integration. No exact duplicate PRs were found for this specific commands variant implementation. |
There was a problem hiding this comment.
Pull request overview
This PR implements variant support for commands as requested in issue #7713. Users can now specify a variant field in command configurations to set a default variant for specific commands, enabling commands to have baked-in reasoning effort levels without requiring manual user selection.
Changes:
- Added optional
variantfield to command configuration schema - Implemented validation to ensure variant is only specified with a model
- Added error handling with helpful messages for invalid variant names
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/opencode/src/config/config.ts | Added variant field to Command schema as optional string |
| packages/opencode/src/command/index.ts | Added variant to Command.Info type and parsed it from config |
| packages/opencode/src/session/prompt.ts | Implemented validation for variant (requires model, checks validity) and passes variant to prompt execution |
| packages/opencode/test/config/config.test.ts | Added test case to verify variant field is correctly parsed from config |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f1ae801 to
08fa7f7Comparekoichiio
commented
Jan 31, 2026
Please feel free to let me know if you're interested in this PR, and then I can resolve the conflicts |
Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
What does this PR do?
Fixes#7713 by the following:
How did you verify your code works?
packages/opencode/test/config/config.test.tsfor config parsing.opencode.jsonin the root:Consideration
When #7156 or #7140 lands, its model-default variant feature might need to be integrated.