ProtectedderivedMemoized getDerived, dropped whenever a discovery reports something new.
Protected ReadonlydiscoveryReadonlyonFired when the marked models or the featured set change.
Protected ReadonlyonProtected ReadonlypreferenceProtectedcompareOrders two candidates of the same provider; index preserves the reported order as the last resort.
ProtectedgetWhat the last discovery implies, computed once and kept until it changes. The chat input asks per model on every render, and ranking each provider's models per question would mean sorting the whole catalogue as many times as it has entries.
The ids the user marked explicitly, the ones offered by default excluded.
ProtectedgetThe featured ids across all providers that participate in discovery, fully qualified.
The ids the user took out of the picker, which would otherwise be offered by default.
Whether the user decided anything about this provider's models, i.e. whether resetting it to the models it offers by default would change what the picker shows.
prefix of the provider's registered model ids, e.g. openai
ProtectedinitWhether the chat input's model picker offers this model, be it featured, marked or hand-configured.
Whether the model is offered automatically because it is among its provider's newest, in which case it cannot be unmarked.
ProtectedisWhether the picker would offer this model without the user marking it: one of the newest of a provider that discovers, or any model of a provider that does not. Nothing was discovered for the latter, so its models are there because someone put them there - a manually configured provider, or a custom endpoint. That is choice enough.
ProtectedparticipatesWhether the model's provider reports a discovery status, i.e. whether featuring applies to it at all.
ProtectedpruneDrops the marked and hidden ids of a provider that a successful discovery no longer offers, so that neither list accumulates models that no longer exist. Only a live discovery prunes: a cached result, a failure or a missing credential says nothing about what the provider offers.
Drops what the user decided about one provider's models, so the picker shows the models that provider offers by default again. The other providers are left alone.
prefix of the provider's registered model ids, e.g. openai
ProtectedselectThe models of one provider that are offered automatically: at most FEATURED_MODEL_COUNT of its undated ids. A release-pinned id is never featured — the undated form of the same model already is, and pinning a release is the deliberate choice the switch on its row makes.
They are ranked by what the provider reports about them, in that order:
-latest pointer the provider maintains at the current model of a family, which only
decides where there are no dates: a provider that reports them dates its pointers as well;gemini-3.7-flash over gemini-2.5-pro).What the model aliases name has no say in this: an alias is a curated list of its own, pointing at the model a purpose should use, which is a different question from which models are worth offering in the picker.
An explicitly configured list (modelOverrides) is featured in full: the user named it. So is a
provider's own nomination (DiscoveredModel.featured), which a provider makes when the
generic ranking cannot serve it — Copilot carries models of many vendors and nominates one each
of the three the other providers offer directly, where "the newest five" would pick five of
whichever vendor numbers its models highest.
Puts a model into the picker or takes it out of it, whichever the current state calls for. Only the deviation from the default is stored: a model offered by default is taken out by an entry in the hidden list, and any other by dropping its entry from the favorites (or adding one).
Protectedwrite
Decides which models the model picker in the AI chat input offers.
Discovery registers everything a provider offers, including one entry per release, which is far more than anyone picks between while chatting. What that picker shows is therefore the favorites: the models that are featured automatically plus the ones the user marked. Everywhere a model is chosen deliberately — an agent's model, a model alias — every discovered model stays on offer.
A model is featured when it is one of the FEATURED_MODEL_COUNT most recently released undated ids of its provider — so
claude-opus-5is featured whileclaude-opus-5-20260401is not. Because the featured set is derived from each discovery rather than stored, a model released tomorrow is offered the day it appears, and the user cannot end up pinned to a stale line-up.Both directions are the user's to override, and only the override is stored: a model offered by default is taken out of the picker by an entry in PREFERENCE_NAME_HIDDEN_MODELS, any other model is put into it by an entry in PREFERENCE_NAME_FAVORITE_MODELS. A model nobody touched appears in neither.
Models of a provider that does not participate in discovery — one whose models are configured by hand, or a custom endpoint — are all favorites: listing them was the user's choice.