OpenCode has no /fast (jiz4oh). A ChatGPT account's own gpt-* model (not
a routing group; catalog.Model.CodexFast, set in magpieModels from
provider.CanFast) is written into opencode.json with each level again as
low-fast … xhigh-fast, or fast alone with no levels. Each asks
service_tier "priority" twice: as an option, which OpenCode 1's
@ai-sdk/openai-compatible sends as it is (read in v1.18.34's
transform.ts and the SDK's getArgs), and in extraBody, which OpenCode 2
sends while it drops an option it doesn't know. The gateway already
sends a Chat request's priority tier to chatgpt.com on Responses and
drops OpenCode 1's stray extraBody field. Other vendors' models, an
OpenAI key's GPT model and groups get no fast variants.
The models block was written whole, so a variant the user added to one
of magpie's models was wiped on every sync. openCodeKept (OpenCode,
DevEco, Air, OpenChamber) keeps a user's variant and one written over
under a name of magpie's; a variant exactly as magpie writes it is
magpie's, so one the model no longer has goes. agent-wiring.md says so.
Run:
- go test -tags nogui -p 1 -count=1 -run 'OpenCode|OpenChamber|Air|DevEco|Deveco|Variant|Theirs|Kept|CodexTier|MagpieModels|Fast' ./internal/agent/: ok
- go test -tags nogui -p 1 -count=1 ./internal/catalog/: ok
- go test -tags nogui -p 1 -count=1 -run 'Fast|Tier|Codex|OpenCode' ./internal/gateway/: ok
- New: TestOpenCodeCodexFastVariants (written config, user variants kept,
stale one dropped, second sync byte-identical, relay/gpt-5.5 and
codex/codex-auto-review without fast), TestOpenCodeVariants fast cases,
TestOpenCodeFastVariantReachesCodex (Chat as OpenCode 1 and 2 send it,
streamed and whole, against a fake ChatGPT backend: service_tier
priority, effort kept, no extraBody; none without the variant).
- Broken by hand, each red: CodexFast never set; theirsKept back in
place of openCodeKept; user variants not read; stale variants kept;
extraBody not written; gateway's Chat parse not reading priority.
- Real use: the exact opencode.json the test writes, base URL pointed at
a fake server, in a sandbox HOME, with opencode v2.0.25:
-m "magpie/codex/gpt-5.5#xhigh-fast" sent reasoning_effort xhigh and
service_tier priority; #medium sent no tier.
- gofmt -l clean; go vet -tags nogui for GOOS=darwin, linux, windows on
internal/agent, internal/catalog, internal/gateway: clean.
Not tried: an OpenCode 1.x binary (read from source only), a real
ChatGPT account's priority tier.
Full suite: SUITE_LINE
Trae CN's kimi-k3 / kimi-k3-max / kimi-k3-auto think, and /v1/models
said reasoning: true, but Pi's models.json was written reasoning: false:
piModelJSON read the levels alone. Pi then offered off alone and
`magpie pi effort high` was clamped to off.
provider.Entry.Thinks() (Reasoning or levels) is now the one judgement:
/v1/models' modelObject and magpieModels, which every agent export
reads, both take it. Pi writes reasoning from it, with no
thinkingLevelMap when the levels aren't known, so Pi offers its own off
to high (getSupportedThinkingLevels, read in Pi's bundle) and the
gateway fits them (fitFor caps a switch-only model at high, #214).
Command Code is told reasoning alone for such a model, which its BYOK
reference takes for low/medium/high. OpenCode, Alma and Zed already
judged it so.
Left as they are: omp (pi-catalog's getSupportedEfforts gives a
reasoning model without thinking.efforts no levels, so the flag alone
buys nothing), jcode (how it reads reasoning with no effort not
verified), Crush (can_reason without levels sends no effort on its
openai type), cline/workbuddy/zcode (they write level lists only).
TestOpenCodeNoResellerLevelsForSwitchModel pinned Xiaomi's
mimo-v2.6-flash (a thinking switch alone) as reasoning: false in Pi; it
is now reasoning: true with no map, so Pi still offers no xhigh or max.
Run (worktree, sandbox HOME, -tags nogui -p 1):
- new TestThinkingWithoutLevelsReachesTheExports (trae-cn/kimi-k3-max):
green; red with Pi's old line ("Pi offers [off]") and red with
Command Code's case removed
- internal/agent -run 'Pi|CommandCode|CC|Cc|Thinking|Reason|OpenCode|
Alma|Zed|Omp|JCode|Jcode|Crush|Route|MagpieModels': ok (382s)
- internal/gateway -run 'Model|Reason|Thinks': ok
- internal/provider -run 'Entry|Reason|Thinks|Catalog': ok
- gofmt -l clean; go vet -tags nogui darwin/linux/windows on agent,
provider, gateway: clean
Not tried: a real Pi against a real Trae CN account; whether Xiaomi
takes Pi's "minimal" for mimo-v2.6-flash (the gateway passes a level
it has no list for as asked).
Full suite: SUITE_LINE
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.