fix(opencode): add runtime model fallback - #2342
Conversation
|
Warning Indent Zero is shutting down on August 7th. Please migrate over to Indent 2.0 to continue getting PR reviews.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughOpenCode now includes runtime fallback settings, additional provider models, and the ChangesOpenCode fallback support
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
eaae25c to
bd05464
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
spec/llm_update_spec.sh (1)
121-123: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert every fallback setting.
The jq expression checks retry codes, maximum attempts, and model order, but it does not check
enabled,cooldown_seconds,timeout_seconds, ornotify_on_fallback. A generated file can disable fallback or change timing while this test still passes.Proposed predicate extension
- .retry_on_errors == [401,404,429,500,502,503,504] and .max_fallback_attempts == 5 and .fallback_models == ["shunkakinoki/deepseek-v4-pro","shunkakinoki/gemma-4-31b-it","shunkakinoki/glm-4.7","shunkakinoki/minimax-m3","shunkakinoki/free"] + .enabled == true and + .retry_on_errors == [401,404,429,500,502,503,504] and + .max_fallback_attempts == 5 and + .cooldown_seconds == 60 and + .timeout_seconds == 30 and + .notify_on_fallback == true and + .fallback_models == ["shunkakinoki/deepseek-v4-pro","shunkakinoki/gemma-4-31b-it","shunkakinoki/glm-4.7","shunkakinoki/minimax-m3","shunkakinoki/free"]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@spec/llm_update_spec.sh` around lines 121 - 123, Extend the jq predicate in “generates a separate OpenCode fallback chain” to also assert the expected enabled state, cooldown_seconds, timeout_seconds, and notify_on_fallback values, while preserving the existing retry codes, maximum attempts, and fallback_models order checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@spec/llm_update_spec.sh`:
- Around line 121-123: Extend the jq predicate in “generates a separate OpenCode
fallback chain” to also assert the expected enabled state, cooldown_seconds,
timeout_seconds, and notify_on_fallback values, while preserving the existing
retry codes, maximum attempts, and fallback_models order checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ce03c0cf-f102-49e8-a5e2-e740b25bc878
📒 Files selected for processing (7)
config/opencode/default.nixconfig/opencode/opencode-fallback.jsoncconfig/opencode/opencode-fallback.tpl.jsoncconfig/opencode/opencode.jsoncconfig/opencode/opencode.tpl.jsoncscripts/llm-update.shspec/llm_update_spec.sh
Summary
Validation
Plugin source: https://github.com/youngbinkim0/opencode-fallback