Skip to content

fix(api): list self-aliased providers in canonical models catalog mode - #12381

Merged
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
pacocartones:fix/models-catalog-canonical-self-aliased
Sep 2, 2026
Merged

fix(api): list self-aliased providers in canonical models catalog mode#12381
diegosouzapw merged 2 commits into
diegosouzapw:release/v3.8.51from
pacocartones:fix/models-catalog-canonical-self-aliased

Conversation

@pacocartones

Copy link
Copy Markdown
Contributor

Summary

  • GET /v1/models with MODELS_CATALOG_PREFIX_MODE=canonical (or ?prefix=canonical) dropped every chat row of a provider whose registry alias is undefined (antigravity) or equal to its own id (agy, most built-ins). Each emission loop pushes alias/model only when includeAlias and canonicalProviderId/model only 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.
  • The alias row is now treated as the canonical row whenever the ids coincide (selfAliased), in the static, synced, custom and alias-backed loops; the canonical branch's !== alias guard is untouched, so dual and alias output are unchanged and cannot double up. Docs that described the omission as intended are updated.

Related Issues

Validation

  • Change type: provider / routing
  • Focused tests and category gates from the golden path: tests/unit/12058-models-catalog-canonical-self-aliased.test.ts RED 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:core 0; check:changelog-integrity OK; check:env-doc-sync OK; check:docs-sync OK
  • npm 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)
  • Reconciled with the current active release base release/v3.8.51@158647618; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR
  • SonarQube is temporarily opt-in while the private project has no quota; it is not a PR gate.

Tests 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/ vs claude/) proving dual/alias counts are unchanged.

Coverage Notes

  • All four touched branches in src/app/api/v1/models/catalog.ts are 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

  • Behaviour change: canonical mode now lists every active self-aliased provider (previously omitted, and documented as such in API_REFERENCE.md, ENVIRONMENT.md and .env.example; those docs are updated here).
  • The issue scoped the ask to the static loop; the same drop was reproduced for built-in providers in the synced, custom and alias-backed loops, so all four are covered to avoid a second round-trip. If a narrower change is preferred, the three non-static sites are single-line reverts with their own assertions to drop.
  • The pre-commit hook also Prettier-formatted catalog.ts:925-933 (pre-existing formatting debt).

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>
@diegosouzapw
diegosouzapw merged commit 990aeca into diegosouzapw:release/v3.8.51 Sep 2, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(api): Antigravity models not listed when MODELS_CATALOG_PREFIX_MODE=Canonical

2 participants