feat(models-info): let the modelsInfoUrl catalog hide text-only / unmatched models - #68
Merged
Merged
Conversation
…ched models Lets the modelsInfoUrl catalog take total precedence over whatever populated provider.models first (hand-written config, or oauth2's /v1/models discovery): with the flag on, a model is deleted outright if the catalog reports it text-in/text-out only, or if the catalog has no entry for it at all. Off by default; only ever prunes existing entries, never invents new ones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
✅ AI Governance check passedThis PR declares AI usage, references a source of truth, and provides verification evidence. Thank you. |
…esh scheduler Adds a per-provider scheduler that re-checks modelsInfoUrl on the same modelsInfoTtlSeconds cadence that already governs cache freshness (no new config surface), so a long-lived OpenCode process doesn't stay stuck with whatever the catalog looked like at boot. It's a cache-warming mechanism for the next config-hook run, not a live in-session update — no channel exists for that in OpenCode's plugin API. Wired via config (start/restart) and dispose (stop); timers are unref()'d so a short CLI invocation is never kept alive by it. Also refactors enrichProvider's per-model branching into a single reconcileModel() decision function, and splits loadRecord's fetch logic into a reusable fetchAndCache() shared with the new refresh path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This was referenced Jul 28, 2026
Merged
Merged
stephane-segning
added a commit
that referenced
this pull request
Jul 28, 2026
Bump all eleven workspace packages to 0.10.0. Needed because npm's @vymalo/opencode-models-info@0.9.0 was already published on 2026-06-29 (confirmed by pulling the tarball and grepping for modelsInfoHideTextOnly/reconcileModel/startCacheRefreshSchedulers — none present), so today's models-info work (#68) and the fast-uri audit fix (#70), both merged under the still-0.9.0 version line, could never actually reach npm: publish.yml's own guard silently skips re-publishing an already-existing version. CHANGELOG changes: split the mis-filed [0.9.0] "unreleased" entry — the two models-info bullets and the fast-uri fix move to a new [0.10.0] — 2026-07-28 section; [0.9.0] is re-dated to 2026-06-29 (the actual npm publish timestamp) and keeps only what that publish really contained (devtools/devtools-mcp + docs). Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Summary
This PR changes:
meta.modelsInfoHideTextOnlyprovider option to@vymalo/opencode-models-info.true, themodelsInfoUrlcatalog becomes authoritative for which models exist, not just their metadata: a model is deleted fromprovider.modelsoutright (instead of being enriched) if the catalog reports it as text-in/text-out only, or if the catalog has no entry for it at all.docs/models-info.md,packages/opencode-models-info/README.md,CLAUDE.md/AGENTS.mdcomposition-contract section) andCHANGELOG.md.It solves:
modelsInfoUrlcatalog prune or override membership; the plugin only ever merged metadata onto models that already existed.2. Intent
The intent of this PR is:
3. Scope
In Scope
meta.modelsInfoHideTextOnlyboolean option (defaultfalse), parsed inconfig.ts.isTextOnlyModality()helper inmapping.ts.plugin.ts'senrichProvider: drops a matched-but-text-only model, and (when the flag is on) drops any model the catalog doesn't mention at all.models_info_model_hidden_text_onlyandmodels_info_model_hidden_unmatched(debug), plushiddenCounton themodels_info_enrichedsummary event.config.test.ts,mapping.test.ts,plugin.test.ts) and docs/README/CHANGELOG updates.Out of Scope
provider.modelsentries for catalog models that discovery/config never listed (only pruning existing entries is supported — see the "Config shape" discussion in the PR description below).4. Verification
I verified this change by:
Commands run:
pnpm --filter @vymalo/opencode-models-info test pnpm -r build pnpm -r typecheck pnpm coverage pnpm lint pnpm format:checkResults:
5. Screenshots / Evidence
Add evidence here:
models_info_model_hidden_text_only/models_info_model_hidden_unmatcheddebug events, exercised inplugin.test.ts6. Risk Assessment
Risk level:
Potential risks:
modelsInfoHideTextOnlywithout realizing "unmatched → dropped" is part of the semantics could lose a hand-configured model that the metadata endpoint simply doesn't know about.Mitigation:
debug(models_info_model_hidden_text_only/models_info_model_hidden_unmatched) and rolled up intohiddenCounton themodels_info_enrichedsummary event, so the behavior is diagnosable via--log-level DEBUG.7. AI Usage Declaration
AI was used for:
Human verification:
8. Reviewer Focus
Please focus your review on: