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.
The plugin host read a model's capabilities.input only for "image", and
fromModelsDev hard-coded output to text, so /v1/models listed
opencode-zen-free's muse-spark-1.3-contributor-free (models.opencode.ai:
input text/image/audio/video/pdf) as ["text","image"] with no output.
- host.js: fromModelsDev and the config merge keep modalities.input and
.output whole; the listing sends inputs/outputs, the kinds the
capabilities object marks true, in OpenCode's order.
- plugin.Model gets Inputs/Outputs; pluginCatalog puts them on
catalog.Model's new InputModalities/OutputModalities (input only where
the plugin said what it takes, as ImageInput already is).
- catalog: models.dev entries and a vendor's live list (now reading
modalities.output) fill the same fields; Decorate carries the catalog's
when the live list says nothing, beside ImageInput.
- provider.Entry.Modalities() is what the gateway lists: the source's
kinds, with "image" still decided by Images, so the user's own
"takes images" override still wins and the other kinds stay.
Not changed: the 7 models the report lists as having lost their levels
have reasoning_options [] upstream (models.opencode.ai), so "reasoning,
no levels" is what they are; mimo-v2.6-flash turns away levels (#214).
DSH's model kinds and Muse's list still say text/image only.
Tests: TestPluginModelModalities (gateway) with the reporter's literal
metadata: muse-spark's config as opencode-zen-free 0.1.3's configModels
writes it, and mimo-v2.6-flash-free's capabilities as its models hook
lists them; a model said nothing of stays unlisted, and the image
override drops image only. TestFetchedModalitiesKeepEveryKind (catalog).
Broken by hand: host.js without inputs gives the report's [text image]
(red); Entry.Modalities without the Inputs branch (red); Decorate
without the fill (red). Run: go test catalog, plugin, provider, gateway;
gofmt -l; GOOS=linux and windows go vet on the four; go test ./...
green on 76db4c6c2+this; after rebasing on e9b16ca18 the four packages
again: catalog, plugin and gateway green; provider red once in a run of
all four together (the failing test's name was cut off by a tail), then
green 3 runs of 3, two of them concurrent.
A model not under its provider's own models.dev vendor (a relay or provider of the user's, a live id that doesn't match, or a preview/-exp or typed id Known looks up) took the levels most listed for it across all of models.dev. For mimo-v2.6-flash those are the resellers' (llmgateway, counted once per upstream host it lists, and requesty, up to max), while Xiaomi lists it with a thinking switch alone. OpenCode was offered variants up to max, Pi and Codex the same levels, and the gateway passed max on unchanged (fitEffort keeps an effort when no levels are known), which Xiaomi turned away with a 400. The same held for Zhipu's glm-5/5.1/5v-turbo, Kimi k2.6, MiniMax M2.x, gemma-4 and others whose makers give no levels while resellers give up to max.
Now catalog.ListedBy looks a model up in given catalogs (vendor prefix, case, a ':free' or '(…)' suffix aside) and gives the levels listed there, none for a switch or no options, and skips an entry with a token budget alone (Claude 4.5), which says nothing of efforts. Known looks in the provider's own catalogs first, and every borrow (Known, effortsOf) asks the makers' catalogs (vendor presets, less Groq and Ollama Cloud, marked Hosts as they serve others' models) before the crowd. The crowd vote counts a provider once per list, so an aggregator listing a model under several hosts no longer outvotes the rest. Provider.Levelless says a model is known to have no levels, and the gateway (fitFor, on the direct and fallback paths) sends such a model no more than high; a model whose levels are simply unknown is still sent what was asked.
Tests: TestEffortsOfOneVoteAProvider and TestListedBy (catalog); TestMakerLevelsBeforeResellers (provider: Xiaomi's preset, a preview left out of the list and a relay get no levels, an unlisted model and a budget-only Claude one still borrow, Levelless); TestOpenCodeNoResellerLevelsForSwitchModel (opencode.json has empty variants for Xiaomi's and a relay's mimo, three for a reseller-only model; Pi has no reasoning or thinkingLevelMap for mimo); TestSwitchModelSentNoMoreThanHigh (gateway: mimo asked max/xhigh sent high, low as asked, an unknown model max). The agent and gateway tests fail on main. An audit of every preset against the current models.dev snapshot found the cases above. Not tested with a real Xiaomi key or a running OpenCode. go build -tags nogui (and linux, windows), go test -tags nogui ./... pass.
A model's image input is taken from models.dev and the provider's own list, and a group's from its members: only a model known to be text-only is refused an image — one whose support is unknown still gets it, and Codex, OpenCode and Pi are told which models take images. An image the user attaches for a text-only model answers 400 in the client's own format before the upstream is asked; an image earlier in the chat, or one a tool returned (Claude Code's Read, Codex's view_image, a Chat tool message), becomes a short text note, so a chat that met a picture carries on after a switch to a text-only model. Thanks @herrkaefer.
A signed-in Claude Code is now offered as a provider (claude/…) like Codex
and Copilot. Anthropic classifies another agent's system prompt as
third-party traffic even over Claude Code's OAuth, so magpie drives the
real local claude binary for every generation: the caller's tools are
bridged in over MCP (magpie claude-mcp-helper), and tool results resume
the same Claude Code turn. Token counting is estimated locally so the
OAuth token takes no side path.
No model list is compiled in any more. The built-in catalog, preset
defaults and Claude Code's alias list are gone; the picker shows the
models.dev catalog (refreshed in the background when stale) layered with
each vendor's own /models answer, and signed-in accounts fetch theirs at
start-up. Whether a model rejects temperature/top_p now comes from
models.dev rather than a name prefix.
The gateway retries a Chat request on the Responses endpoint when the
model is Responses-only, and remembers that. Recent calls keep the first
256 KB of request and response bodies, viewable in the call list. The
Usage tab shows subscription allowances (Claude, Codex, Copilot) as the
vendors report them.