feat(opencode): add support for --variant flag#123
Conversation
- Introduced a new 'variant' configuration option for specifying provider-specific reasoning effort (high, max, minimal). - Updated initialization logic to accept and set the variant. - Enhanced argument parsing to include the model variant when specified. - Added a test case to verify the acceptance of the variant configuration.
|
@manascb1344 is attempting to deploy a commit to the plgeek Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds CLI and config support for a model "variant" (e.g., minimal, high, max). The variant is captured during run parsing, merged into agent runtime options, stored in the OpenCode agent plugin, and passed as a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant ConfigLoader as Config/Runtime
participant AgentPlugin as OpenCodeAgentPlugin
participant OpencodeCLI as OpenCode CLI
User->>CLI: run --agent opencode --variant high ...
CLI->>ConfigLoader: parse args -> options.variant = "high"
CLI->>ConfigLoader: load/merge agent options
ConfigLoader->>AgentPlugin: initialize(config with options.variant)
AgentPlugin->>AgentPlugin: store variant
CLI->>AgentPlugin: request command args
AgentPlugin->>OpencodeCLI: spawn `opencode run ... --variant high`
OpencodeCLI->>User: execute external CLI with variant
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ncode-variant-support
- Add validation for variant values (minimal, high, max) in initialize() - Add variant validation in validateSetup() for setup wizard - Add --variant CLI flag to run command - Pass variant from CLI to agentOptions in config building - Add comprehensive tests for variant functionality: - CLI parsing tests for --variant flag - Initialization tests for all valid variants - Validation tests for invalid variants - Help text verification Co-authored-by: manascb1344 <[email protected]>
Different models support different variant values (e.g., Gemini uses minimal/high/max, other models may use different values). Validation should be delegated to the OpenCode CLI, which knows what each model supports. - Remove strict validation of variant values in initialize() - Remove variant validation in validateSetup() - Update docs to clarify variants are model-specific - Update tests to reflect the delegated validation approach
|
@subsy Are the changes appropriate? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
+ Coverage 46.72% 46.73% +0.01%
==========================================
Files 58 58
Lines 12947 12968 +21
==========================================
+ Hits 6049 6061 +12
- Misses 6898 6907 +9
🚀 New features to boost your workflow:
|
|
Hey @manascb1344, thanks for this PR! 🙌 I've pushed some additions to your branch:
PS for future PRs, please include tests, and (if applicable) docs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ode-variant-support feat(opencode): add support for --variant flag
Summary
Adds support for the
--variantflag to the OpenCode agent plugin, enabling users to control model reasoning effort (e.g.,high,max,minimal) for supported providers like Google Gemini.Changes
OpenCodeAgentPluginto accept avariantconfiguration option--variant <value>to theopencodeCLIUsage
CLI
Config
Verification
bun run lint: Cleanbun run typecheck: Successbun run build: SuccessRelated Issue
Fixes #122
Summary by CodeRabbit
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.