fix(models): read model metadata from the live GonkaGate catalog - #14
fix(models): read model metadata from the live GonkaGate catalog#14Dankosik wants to merge 3 commits into
Conversation
Add `deepseek-ai/deepseek-v4-flash-0731` (400K context, chat_completions, @ai-sdk/openai-compatible) to the curated model registry as the single recommended entry and demote `moonshotai/kimi-k2.6` to `recommended: false` so `createCuratedModelIndex` keeps its at-most-one-recommended-validated invariant. DeepSeek stays `validationStatus: "candidate"` because no MiMoCode workflow proof exists for it yet. Docs, docs-contract, and package-contract tests are updated to match. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The first revision marked deepseek-ai/deepseek-v4-flash-0731 as the recommended curated entry while it is still validationStatus "candidate". Every consumer of the recommended concept filters on "validated" first (selection.ts, createCuratedModelIndex, managed-provider-config.ts), so the flag was inert: it did not make DeepSeek the curated default, it only removed the existing one. It also collapsed RecommendedValidatedCuratedModel to never and gave getRecommendedValidatedModel() the literal return type undefined. DeepSeek V4 Flash 0731 stays in the registry as a candidate. The curated recommendation returns to moonshotai/kimi-k2.6, the only entry with MiMoCode workflow proof. Public picker behavior is unaffected: it is built from the live GET /v1/models response, where DeepSeek is already first and therefore already the default. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Follow-up: curated recommendation reverted to a validated modelThe first revision of this PR marked
DeepSeek V4 Flash 0731 remains in the registry as a This does not weaken the user-facing outcome. The public picker is built from the live Blocked follow-up: promoting DeepSeek inside the curated registry requires a real MiMoCode validation run recorded in Local proof after the fix: |
Delete the curated model registry, its pinned context windows, its display names, and the recommended-model flag. Model ids, names, descriptions, context windows, and the non-interactive default now come from GET /v1/models. Optional per-model fields degrade instead of failing, so a gateway that returns only model ids still completes setup and no longer gets a generic zero context limit written into MiMoCode config. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Direction change: the hardcoding approach in this PR has been replaced with live model metadata. What this PR used to do: add Why that was wrong: it made the repository a second source of truth for a catalog GonkaGate already owns. The registry it extended was already drifting - it pinned What replaced it: the curated registry is deleted. Model ids, display names, descriptions, context windows, and the Compatibility, since the gateway change is not deployed yet: the fallback path was written first. Only Not faked: no validation record was invented.
|
What changed
This PR no longer adds a model. It removes the repository's hardcoded model
metadata and makes the installer read everything from the live GonkaGate
catalog.
Hardcoded before
CURATED_MODEL_REGISTRYinsrc/constants/models.ts: four checked-in modelids with pinned display names and context windows
(
262_000for Kimi,205_000for MiniMax,262_000for Qwen), several ofwhich already disagreed with the live catalog.
recommended: trueflag that acted as the default model.provider.gonkagate.models.<id>entry gotlimit: { context: 0, output: 0 }, so a live-catalog run told MiMoCode thatevery model has a zero context window.
docs/model-validation.mdanddocs/how-it-works.mdcarried a second copy ofthe catalog, including per-model context windows.
CONTRACT_METADATA.curatedRegistryPublished.Read live now
GET /v1/models(Bearer auth) is the only source for:name-> the MiMoCode model display name and the picker labeldescription-> picker descriptioncontext_length->provider.gonkagate.models.<id>.limit.context--yes, which isdata[0], the first entry inresponse order. No client-side ranking, sorting, or preference heuristic, and
no checked-in default model id.
src/constants/models.tsis now types only; the package-contract test fails ifa model id, a numeric context value, or a
recommendedflag reappears in it.Behavior against a gateway that has not shipped PR #70
The compatibility window is handled first, not after. Only
idis required.Each optional field degrades independently, and
null, wrong types, and blankstrings are treated exactly like "absent":
namedescriptioncontext_lengthlimitblock is written at allThe context fallback is the important one: the installer writes no
limitblock instead of
context: 0, so MiMoCode keeps its own default rather thanbeing told the model has a zero-size context window. When a limit is known,
both keys are written (
{ context: <live>, output: 0 }) because that is theexact shape proven against MiMoCode in the workflow proof ledger.
Both
context_lengthandcontextLengthare read, so a camelCase gatewayresponse also works.
Deliberate non-changes
src/constants/model-validation.tsis kept as-is. It is a real MiMoCodeworkflow proof ledger for
moonshotai/kimi-k2.6, not catalog metadata: itholds no context window, no display name, and no default. It does not feed
selection or config writes. No record was added for any other model, because
no such validation run happened.
qwen/qwen3-235b-a22b-instruct-2507-fp8prose elsewhere in the repo isleft alone.
Validation
npm ci --no-audit --no-fundnpm run typechecknpm testnpm run format:checknpm run package:checknpm run ciBaseline on this branch before the change was also green (82 tests), so the
7 new tests are net new coverage: legacy id-only catalog, enriched catalog,
null/blank/wrong-typed metadata, positional default, picker labels, and anend-to-end session assertion on the generated
provider.gonkagate.models.🤖 Generated with Claude Code