fix(provider): cross-check models.dev deprecated status against gateway to prevent hiding live models - #185
Conversation
|
I've left a comment in the base issue that this PR closes explaining the issue further and why I think this PR is the right approach. |
…laguna-s-2.1-free works
|
Clean fix. i went through the diff and the cross-check approach makes sense. keeping the #3 protection while un-hiding models the gateway still serves is the right call, and failing open when there's no live data is what i'd want too. good catch on one small thing, not a blocker. with fail-open, models that were previously hidden via stale tests cover all the branches, docs and changelog are in place, CI green. merging this as-is. |
📝 What does this change?
Closes #182
models.devstatus: deprecatedwas hiding live models from the picker.laguna-s-2.1-freeis live and working on the gateway butmodels.devincorrectly marks it deprecated. The extension'sshouldHideDeprecatedModelfilter was hiding it unconditionally.The fix cross-checks
models.devdeprecated status against the live gateway response.shouldHideDeprecatedModelnow only hides when both agree:models.devsays deprecated AND the gateway confirms the model is absent. Offline/fallback paths fail open (no live data → don't hide on stale metadata).This preserves the original #3 protection (gateway can list broken models,
models.dev deprecatedcatches them) while fixing #182 (gateway lists working models, stalemodels.devfalsely hides them).Note on
deepseek-v4-flash-free: The reporter's original example is actually an upstream problem — the gateway lists the model but requests fail with "Model is unavailable". Neithermodels.devnor the gateway is a reliable source of truth for availability. Our fix correctly shows the model (gateway lists it) and surfaces the error clearly when it fails. The real fix fordeepseekis upstream.Files changed
src/provider/settings.tsshouldHideDeprecatedModelgainsliveModelIds?: ReadonlySet<string>parameter; returnsfalsewhen live set confirms the model is present or when no live data is availablesrc/provider/modelList.tsfilterAvailableModelssignature gainsliveModelIds?; gateway fetch buildsSet(ids)and passes it throughsrc/provider/OpenCodeProvider.tsfilterAvailableModelsthreadsliveModelIdstoshouldHideDeprecatedModel; fetcher wiring updatedsrc/test/deprecatedFilter.test.tsdocs/issues/78-20260822-issue182-deprecated-model-gateway-crosscheck.mdCHANGELOG.md[Unreleased]ARCHITECTURE-MAP.mdVerification
models.devlaguna-s-2.1-freedeepseek-v4-flash-freering-2.6-1t-freetrinity-large-preview-free* Shown but fails at runtime — upstream issue, not solvable from extension side.
🧪 How did you test it?
npm run compile✅npm run lint(6 checks) ✅npm test(305+ unit tests including 8 newdeprecatedFiltertests) ✅npm run package✅ (VSIX built)laguna-s-2.1-freeconfirmed working ✅deepseek-v4-flash-freeconfirmed broken upstream (400 error) ✅✅ Checklist
npm run compilepassesnpm run lintpassesnpm testpassesnpm run packageproduces a VSIX