Relays rename models for Claude Code with a "claude-" prefix and/or a
window mark ("[1M]", "[200K]"). Every capability getter looked the bare id
up exactly, so such a model had an empty reasoning menu, no images (the
gateway's vision stand-in described pictures to a model that sees them)
and a 0 window.
Now every getter shares one lookup (lookup -> found -> renamed):
- found is the chain EffortsOf and ContextOf already had (exact, a Bedrock
geography, "(variant)", ":tag"), now also used by Thinks, SeesImages,
NameOf and OutputOf, which matched the exact id only.
- renamed applies only when models.dev lists no model by the id at all
(a new `listed` set of every bare id, whatever it says of it): a window
mark comes off first, and if what is left is listed it is the model
(Claude Code's claude-opus-5[1m] stays claude-opus-5, never "opus-5");
else a "claude-" prefix comes off when the rest is listed and names a
version, so the reporter's counter-example claude-auto[1M] is not
models.dev's router "auto".
- ContextOf gives a mark's window (what the relay serves it at, as Claude
Code takes [1m] for 1M); NameOf keeps the mark ("DeepSeek V4.1 Flash
[1M]") so two models apart by window alone read apart.
- Siblings: PricedBy (last, after the dot/dash match) and ListedBy take
the rename too; Knows follows from ContextOf/EffortsOf/Thinks.
Ran: the reporter's TestRelayRenamedIDLosesCapabilities verbatim, plus
tests for every getter on the renamed forms, Claude [1m] ids, a listed
claude-glm-5 keeping its own (empty) levels over glm-5's, near misses
(claude-auto, -flashy, [fast], [infm], anthropic- prefix) matching
nothing, gpt-5.5/auto/opus-5/glm-5 unchanged. Broken by hand seven ways
(no rename, no listed gate, no version check, mark window ignored, prefix
before the mark-stripped id, PricedBy or ListedBy without the rename):
each FAILs naming the getter. Against today's models.dev api.json:
claude-deepseek-v4.1-flash[1M] -> low,high,max, 1M, images; claude-auto[1M]
-> nothing; claude-code (listed) as before. gofmt -l clean; go vet,
GOOS=linux go vet -tags nogui, GOOS=windows go vet ./...; go build for
darwin, linux (nogui), windows; go test -tags nogui ./... in a temp HOME
all ok.