-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add OpenCode model registry integration for daily model refresh (t194) #810
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
… (t194) Add OpenCode as a model discovery source, replacing direct API key probing when the OpenCode CLI is available. This enables model availability checks without requiring individual provider API keys in the environment. model-registry-helper.sh: - Add sync_opencode() as Phase 3 (preferred, from ~/.cache/opencode/models.json) - Filter to relevant providers only (anthropic, openai, google, etc.) for performance - Use batch SQL inserts instead of per-model queries (306 models in <1s) - Phase 4 (direct API probing) auto-skips when Phase 3 succeeds model-availability-helper.sh: - Add 'opencode' as a known provider with cache-based health checks - Add _is_opencode_available() and _opencode_model_exists() for instant lookups - Update get_tier_models() to prefer opencode/* model IDs when available (routed through OpenCode's gateway, no direct API keys needed) - Add OpenCode cache as first model-level availability check tests/test-model-availability.sh: - Add OpenCode integration test section (provider check, model check) - Add opencode to provider check loop Decision: chose OpenCode models cache over direct API probing as primary source — matches existing project convention of using OpenCode as the runtime environment (opencode.json provider config, opencode CLI dispatch).
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces OpenCode as a meta-provider alongside existing providers, adding CLI detection utilities, a local models.json cache mechanism, and conditional integration paths. Expands model availability checks, registry synchronization, and help documentation to recognize and leverage OpenCode when available, with fallback to existing behavior when absent. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client/User
participant Helper as Model Helper<br/>(availability-helper.sh)
participant Cache as OpenCode<br/>models.json Cache
participant CLI as OpenCode CLI
participant API as Provider APIs<br/>(fallback)
Client->>Helper: Request model availability/<br/>tier resolution
Helper->>Helper: Check if OpenCode available
alt OpenCode CLI + Cache Detected
Helper->>Cache: Query local models.json
Cache-->>Helper: Return cached models
Helper->>Helper: Resolve tier using<br/>opencode/* mappings
else OpenCode Not Available
Helper->>API: Fallback to provider API<br/>direct discovery
API-->>Helper: Return provider models
Helper->>Helper: Resolve tier using<br/>standard mappings
end
Helper-->>Client: Return resolved models/<br/>availability status
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing touches
🧪 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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Feb 9 21:20:59 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Changes
model-registry-helper.sh
model-availability-helper.sh
tests/test-model-availability.sh
Testing
Closes t194
Summary by CodeRabbit
New Features
Documentation
Tests