Files
magpie/internal/catalog
ggbdpqandfactory-droid[bot] d1ddb7defe catalog: a model no catalog lists by its id has what its maker's entry says of it — window, thinking, images, name — not just a price (#1565, ggbdpq)
What changed: #1520 prices the id an entry names as its
canonical_model_id, but the capability tables only counted entries
listed by an id, so the model behind the id was unknown all the same:
gpt-5.6-cyber (OpenAI's gpt-daybreak-red-latest, canonical
openai/gpt-5.6-cyber) had no window, reply limit, thinking, images or
name — asked as given (WorkBuddy's shape) or behind a relay's prefix.
An entry now votes for the canonical id it names too, when no catalog
lists that id: one listed by its id keeps the answers it has. The
per-entry vote moved into a closure (vote) whose branches are the ones
it replaces, keyed the same for a listed id.

Review (yetone's session): TestCanonicalOnlyIDCarriesItsMakerWord and
the updated TestCanonicalIDIsNeverTakenForAnother fail on the previous
catalog.go (window, reply limit, thinking, images and name all empty for
gpt-5.6-cyber and claude-gpt-5.6-cyber; 0 and "" for claude-sonnet-4-0)
and pass with it. The expectations were moved to the literal catalog:
Daybreak Red's window is its input limit, 272000, not the 400000 context
(as every listed model's is), and Cortecs's name is "Claude Sonnet 4
(latest)". A sweep of every listed and canonical id (plain, claude-,
[1m]) through ContextOf, OutputOf, Thinks, SeesImages, NameOf,
EffortsOf, Knows and PricedBy on the local models.dev cache, before and
after: no answer for a listed id changed; the 23 canonical-only ids
and their renames gained theirs. The full suite, gofmt and the cross-OS
vets were run on the series.

Author's run: the red/green above; go test -tags nogui
./internal/catalog ./internal/usage ./internal/provider green; go test
-tags nogui ./... green but TestOffline (red on the baseline too) and
TestSearchFollowsTheSearchersProxy (green alone); gofmt -l clean; go
vet, GOOS=linux and GOOS=windows vet on internal/catalog clean.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-10-11 13:35:56 +08:00
..
catalog: a model the provider's catalog doesn't list is named as the other providers name it (John on Discord #feedback: GLM Coding Plan and ZCode name the same models in different case, in the provider list and the group picker) — the Coding Plan's /models (open.bigmodel.cn and api.z.ai, read with a real key) gives ids alone, glm-5-turbo, glm-5.3-flashx …; catalog.Decorate names only those Zhipu's models.dev entry (zhipuai) lists, so glm-5-turbo kept its id as its name beside ZCode's GLM-5-Turbo. models.dev's load now keeps each model's name as most providers serving it give it (a name that is only the id casts no vote), catalog.NameOf reads it by bare id in any case, and catalog.Named fills it in for a model still named by its id: in Available's live list and for a pick the list doesn't have. Ids, and what is sent upstream, are unchanged; a name the user gave stays theirs (Catalog's Name, with the new one as Default); an Azure provider is left out, its deployments named as their owner named them. TestModelNamedAsElsewhere (the Coding Plan's real ids, a user name, an Azure deployment) fails without the provider change and passes; TestNameOf is new. TestSearcherChosen read whatever catalog an earlier test had left loaded, and now resets it: with none, its lists' models go by their ids, as it expects. go test ./internal/catalog/ ./internal/provider/ ./internal/gateway/ ./internal/gui/ . pass; -race -count=5 for the two new tests; go vet, linux(nogui)/windows builds pass. No GUI change (the GUI and the group picker show name || id).
2026-10-06 13:09:40 +08:00