Files
magpie/internal/catalog
yetone 9964535adc provider: a model models.dev has just listed without its reasoning levels takes its family's, so Codex's picker offers them for a relay's gpt-6.1-sol (NextCommit on Discord)
NextCommit's Codex showed no reasoning-effort picker for a relay's (an
OpenAI-compatible key provider) gpt-6.1-sol, while gpt-6-astra had one, and
magpie's log said the effort went from none to low. models.dev had listed
gpt-6.1-sol as a reasoning model but without reasoning_options yet, or not
at all, so magpie knew no levels for it: Codex's catalog got
supported_reasoning_levels [] (no picker), and the gateway, not knowing
"none" was one of the model's levels, sent Codex's "none" as "low" (#899).

What changed:
- catalog: a thinking model with no levels of its own and no budget takes
  the levels of the newest model of its models.dev family (same provider,
  thinking, with levels) released on or before it (mdProvider.levels).
  Used by Provider and ListedBy. A model with its own levels, a budgeted
  one, one that doesn't think, or one with no family is as before.
- catalog.KinEfforts: for an id no provider lists, the levels of the newest
  listed model of the same shape with the version numbers left out
  (gpt-6.1-sol -> gpt-#-sol), never a budgeted or non-thinking one.
- provider.borrowedEfforts: tries ListedBy, then EffortsOf, then
  KinEfforts. Entry.Efforts, which every agent's model list is built from
  (Codex, Claude Code, OpenCode, dsh, ...), goes through it, as do Known,
  Levelless, groups and plugins.
- Xiaomi's mimo, which takes a thinking switch only (#214), still gets no
  levels; gpt-4.1 gets none.

With levels known, an effort the user picks in Codex goes through as
picked. The none->low mapping remains for models whose levels are still
unknown (#899).

What was run:
- New tests: TestFamilyLevels (catalog) and
  TestNewModelTakesItsFamilysLevels (provider, Codex catalog levels for
  relay/gpt-6.1-sol). Both fail with levels() and the KinEfforts call
  neutered (levels "" against the family's), and pass with them.
- Real Codex CLI 0.162.1 under a sandbox HOME against a sandbox magpie
  gateway (127.0.0.1:3592) and a fake relay (127.0.0.1:3591) listing
  gpt-6.1-sol and gpt-6-astra. The models.dev cache had reasoning_options
  stripped from every gpt-6.1-sol entry to match the reporter's.
  - Built from origin/main: magpie-models.json gave relay/gpt-6.1-sol
    default None, levels [].
  - With this change: default medium, levels none..max,ultra.
  - Codex /model showed "Select Reasoning Level for GPT-6.1 Sol · relay".
    Picking Medium, High and None sent reasoning_effort "medium", "high"
    and "none" to the relay.
- gofmt -l; go vet ./...; GOOS=linux go vet -tags nogui ./...;
  GOOS=windows go vet ./...; GOOS=linux and GOOS=windows builds: all
  clean.
- go test ./... under a temp HOME, with GOCACHE and GOMODCACHE
  pinned. Every package passed except four that hit the 10-minute default
  timeout with load average ~40 (TestCopilotSecretToolUsername's 5s
  secret-tool wait as well). Rerun with -timeout 40m -p 2, internal/agent,
  gateway, library and provider all passed.

Not tried: the Claude Code, OpenCode and dsh model files written for the
same relay model; they take Entry.Efforts like Codex.
2026-10-12 19:02:25 +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