fix(api): list self-aliased providers in canonical models catalog mode - #12381
Merged
diegosouzapw merged 2 commits intoSep 2, 2026
Conversation
With MODELS_CATALOG_PREFIX_MODE=canonical (or ?prefix=canonical), GET /v1/models dropped every chat row of a provider whose registry alias is undefined (antigravity) or equal to its own id (agy and most built-ins). Each emission loop in src/app/api/v1/models/catalog.ts pushes the `alias/model` row only when includeAlias is set and the `canonicalProviderId/model` row only when the two ids differ (a dual-mode duplicate guard). For a self-aliased provider both ids are the same string, so in canonical mode neither branch fired and the provider vanished; only the ungated image-registry row (antigravity/ gemini-3.1-flash-image) survived, exactly as reported. diegosouzapw#11832 (PR diegosouzapw#11918) fixed the same class for custom provider nodes with `includeAlias || Boolean(prefix)` but left built-in providers behind, and did not touch the static curated-catalog loop at all. Treat the alias row as the canonical row whenever the two ids coincide (`selfAliased`), in the static, synced, custom and alias-backed loops. The canonical branch still skips those providers, so dual mode cannot emit a duplicate, and alias/dual output is unchanged: the new test asserts the same id set for antigravity, agy and a synced/custom/ alias-backed api-key provider across all three modes, no duplicate ids, and that a normally-aliased provider (cc/ vs claude/) keeps its gating. Docs that described the omission as intended (API_REFERENCE, ENVIRONMENT, .env.example, VSCODE-COPILOT guide) now describe the fixed behaviour. Closes diegosouzapw#12058 Co-authored-by: Leon Marcos <leonaniagomez@gmail.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.
Summary
GET /v1/modelswithMODELS_CATALOG_PREFIX_MODE=canonical(or?prefix=canonical) dropped every chat row of a provider whose registryaliasis undefined (antigravity) or equal to its own id (agy, most built-ins). Each emission loop pushesalias/modelonly whenincludeAliasandcanonicalProviderId/modelonly when the ids differ; for a self-aliased provider both are the same string, so neither fired. fix(models): expose custom node models in canonical prefix mode (#11832) #11918 fixed the class for custom nodes but not built-ins, and not the static loop.selfAliased), in the static, synced, custom and alias-backed loops; the canonical branch's!== aliasguard is untouched, sodualandaliasoutput are unchanged and cannot double up. Docs that described the omission as intended are updated.Related Issues
Validation
tests/unit/12058-models-catalog-canonical-self-aliased.test.tsRED 3/4 on the base, GREEN 4/4 with the fix; per-site mutation check (4 sites killed, overshoot mutant killed); the 68 catalog-importing unit files 417/418 (the one failure,9147-catalog-eventloop-yield, fails identically on the unmodified base: environment timing);npm run typecheck:core0;check:changelog-integrityOK;check:env-doc-syncOK;check:docs-syncOKnpm run lint— repository-wide eslint exit 0 (run with--pass-on-unpruned-suppressions; the literal command reports only pre-existing unused global suppressions on this base)release/v3.8.51@158647618; focused checks rerun afterwardTests Added Or Updated
tests/unit/12058-models-catalog-canonical-self-aliased.test.ts(new): antigravity and agy static rows in canonical mode; a self-aliased built-in's synced, custom and alias-backed rows; a normally-aliased control (cc/vsclaude/) proving dual/alias counts are unchanged.Coverage Notes
src/app/api/v1/models/catalog.tsare exercised by the new file; the synced-audio sub-branch was deliberately left unchanged because its mutant survived (that row comes from the primary synced push).Reviewer Notes
API_REFERENCE.md,ENVIRONMENT.mdand.env.example; those docs are updated here).catalog.ts:925-933(pre-existing formatting debt).