Skip to content

Conversation

@sudo-tee
Copy link
Owner

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.

image image

This should fix #191

Copy link
Contributor

Copilot AI left a 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.
@sudo-tee sudo-tee merged commit 5e9142a into main Jan 20, 2026
10 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add command "variant cycle" and model variant indicator

2 participants