feat(opencode): add model variant support and cycle command#193
Merged
feat(opencode): add model variant support and cycle command#193
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive support for model variants, allowing users to select and cycle through different configurations (e.g., reasoning effort levels) for models that support them.
Changes:
- Introduced variant picker UI and cycle functionality with keybindings (
<leader>oV,<M-r>,/variant) - Added persistent variant storage per model in
~/.local/state/opencode/model.json - Refactored model state management into a dedicated module shared between model and variant features
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/opencode/variant_picker.lua | New picker UI for selecting model variants with current indicator |
| lua/opencode/model_state.lua | Extracted and extended state persistence for favorites, recent models, and variants |
| lua/opencode/model_picker.lua | Refactored to use centralized model_state module |
| lua/opencode/core.lua | Added configure_variant/cycle_variant functions and model change subscription for variant loading |
| lua/opencode/state.lua | Added current_variant field to global state |
| lua/opencode/types.lua | Added variant type definitions and SendMessageOpts field |
| lua/opencode/util.lua | Extended parse_run_args to support variant= parameter |
| lua/opencode/ui/footer.lua | Display current variant in footer with dedicated highlight |
| lua/opencode/ui/highlight.lua | Added OpencodeVariant highlight group |
| lua/opencode/config.lua | Added keymaps for variant selection and cycling |
| lua/opencode/config_file.lua | Documented get_model_info return type includes variants |
| lua/opencode/api_client.lua | Updated create_message parameter documentation for variant |
| lua/opencode/api.lua | Exposed configure_variant/cycle_variant API and slash commands |
| README.md | Comprehensive documentation for variant feature usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add per-model variant support and UI/commands to select and cycle variants. - Add lua/opencode/model_state.lua to persist favorites, recent and selected variants - Add lua/opencode/variant_picker.lua and expose configure_variant / cycle_variant - Thread variant through API/client, core send flow, config, types, utils and UI footer - Update model picker, keymaps, highlights and state to load/save the current variant Enable selecting, remembering, and cycling model variants for the active model.
3ecb050 to
81cd41c
Compare
aweis89
pushed a commit
to aweis89/opencode.nvim
that referenced
this pull request
Jan 29, 2026
…#193) * feat(opencode): add model variant support and cycle command Add per-model variant support and UI/commands to select and cycle variants. - Add lua/opencode/model_state.lua to persist favorites, recent and selected variants - Add lua/opencode/variant_picker.lua and expose configure_variant / cycle_variant - Thread variant through API/client, core send flow, config, types, utils and UI footer - Update model picker, keymaps, highlights and state to load/save the current variant Enable selecting, remembering, and cycling model variants for the active model. * fix: remove duplicate logic to save variant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add per-model variant support and UI/commands to select and cycle variants.
Enable selecting, remembering, and cycling model variants for the active model.
This should fix #191