fix(model-resolution): add free-model fallback for free-only provider setups (fixes #1883)#3821
fix(model-resolution): add free-model fallback for free-only provider setups (fixes #1883)#3821mrosnerr wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
2 issues found across 11 files
Confidence score: 3/5
- Free-model detection in
script/free-model-extraction.tsonly checkscost.input, which can misclassify models with billed output or other costs as free and lead to incorrect listings - Workflow change in
.github/workflows/refresh-model-capabilities.ymladds Opencode snapshot generation without the required cloning/reading step, which may break the intended automation flow - Given the two medium-severity issues, there is some risk of functional inaccuracies or workflow failures, so the merge is not risk-free
- Pay close attention to
script/free-model-extraction.ts- incomplete cost checks, and.github/workflows/refresh-model-capabilities.yml- missing Opencode source read step.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="script/free-model-extraction.ts">
<violation number="1" location="script/free-model-extraction.ts:18">
P2: Free-model detection is incomplete because it only checks `cost.input` and can include models with non-zero output or other billed costs.</violation>
</file>
<file name=".github/workflows/refresh-model-capabilities.yml">
<violation number="1" location=".github/workflows/refresh-model-capabilities.yml:32">
P2: Custom agent: **Opencode Compatibility**
Opencode snapshot generation is added without cloning/reading anomalyco/opencode as required by the rule.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
[sisyphus-bot] PR sweep first-pass triage on
Needs rebase + review. Please rebase onto current Assigning |
|
[sisyphus-bot] Hi mrosnerr. 🙏 Thanks for the free-model fallback work for #1883. Coming back to this from the 5/16 triage queue. Issue #1883 was closed on 5/13 with this PR (#3821) linked as the auto-closer reference, but the PR itself hasn't landed yet, so the underlying behavior is still on the prior path. The PR also currently reports CONFLICTING against current If you can spare the time, the cleanest next step is a rebase onto current If you'd rather close this and re-open a smaller, more focused PR layered on top of the current free-provider detection code, that's also fine. Either way, thanks for caring enough to fix the silent paid-model fallthrough; it's a real footgun for users who deliberately configured only free providers. |
… setups (fixes code-yeongyu#1883) Extract model-selection input helpers to dedicated module. Add free-model-fallback module with append strategy: free models are added as a tail to the existing fallback chain rather than replacing it. Derive free-only from availableModels on warm cache (correct signal that distinguishes free-tier from paid Zen subscribers). Fall back to connectedProviders on cold cache only. Skip non-free entries in cold-cache loop when free-only. Free model list is sourced from a generated JSON snapshot (free-opencode-models.generated.json) refreshed by the existing weekly refresh-model-capabilities workflow. Model rotation is now a JSON edit instead of a code change. Paid users are completely unaffected (warm-cache path identical to dev). Free users get free models appended as a safety net after the system chain naturally exhausts. Co-authored-by: MoerAI <skyinbss@gmail.com>
460be58 to
ddefdd9
Compare
|
@code-yeongyu rebased 👍 |
eb25d29 to
2bfad49
Compare
Fixes #1883
Summary
Subagents resolve to paid models when only free providers are configured. This adds a free-model fallback that appends free opencode models to the fallback chain when the user only has free models available.
Paid users are unaffected — detection is based on
availableModels, notconnectedProviders, so Zen subscribers don't get downgraded.Free model list is sourced from a generated JSON snapshot refreshed by the existing weekly
refresh-model-capabilitiesworkflow. Model rotation is a JSON edit, not a code change.Changes
free-model-fallback.tsmodel-selection.tsmodel-selection-input.tsfree-opencode-models.generated.jsonscript/build-free-models.tsscript/free-model-extraction.tsrefresh-model-capabilities.ymlbuild:free-modelson weekly cron*test.ts(×3)Testing
bun run build:free-models— generates snapshot, verified output matches livemodels.dev/api.jsonbun run typecheck— cleanbun run build— cleanbun run test:model-capabilities— 58 pass (includes extraction edge cases + snapshot guardrails)Context
Builds on #3529 (closed by @MoerAI, who created the initial module structure).