-
Notifications
You must be signed in to change notification settings - Fork 34
feat(opencode): add model variant support and cycle command #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
…#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
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