nianshou5 on Discord added their own CLIProxyAPI (CPA) as a custom
provider, and its models offered no reasoning effort in the ChatGPT app
while a plugin's did. CPA's /v1/models gives id, object, created and
owned_by alone (sdk/api/handlers/openai OpenAIModels strips its
registry's thinking levels), so every level comes from magpie borrowing
the model's. That works for an id models.dev knows (gpt-5.5, claude-*,
gemini-*, deepseek-*), but CPA's Antigravity and xAI channels name a
model for the level or speed they serve it at: gemini-3.8-flash-high,
claude-opus-5-5-high, claude-opus-4-6-thinking, gpt-oss-120b-medium,
grok-3-mini-fast. No catalog lists those names, so they had no levels,
and Codex, the ChatGPT app, /v1/models and the gateway's effort fitting
all read none. CPA's own registry gives those models levels or a
thinking budget it fits an effort to.
borrowedEfforts, which is reached only for a model its provider gave
no word on, now tries the id without a trailing
-minimal/-low/-medium/-high/-xhigh/-max/-thinking/-fast
(catalog.Unsuffixed) after every other match failed. A vendor whose own
list names a model so keeps its own word (effortsOf takes the
provider's), and a variant whose base magpie doesn't know
(grok-4.7-build-fast) still takes none. Every list reads Entry.Efforts
or Provider.Known, so Codex CLI's magpie-models.json, the Codex and
ChatGPT apps' /backend-api/codex/models, /v1/codex/models and /v1/models'
reasoning_levels all change together.
The reporter's one visible id, whatstoken/deepseek-v4.1-flash-1017,
already borrowed low,high,max on main against this machine's real
models.dev cache; their other two CPA ids are not known yet (asked on
Discord). So this fixes the class of CPA ids that had none; it may not
be their case.
TestCPAVariantModelsBorrowLevels serves CPA's /v1/models bytes from an
httptest server, fetches them with catalog.Fetch, and checks
Entry.Efforts, Provider.Efforts and the Codex list's
supported_reasoning_levels. It is red with the fallback turned off by
hand (three ids with "" in each list) and green with it.
Run at the pushed head (rebased on origin/main 0b72ccbef):
- go build ./...; GOOS=linux and GOOS=windows go vet ./internal/catalog
./internal/provider: ok
- go test -count=1 ./internal/catalog ./internal/codexcat, and
-run 'CPA|Effort|Level|Borrow|Kin|Host' ./internal/provider: ok
Run at the same change on 7d67910f7, before the rebase:
- gofmt -l internal/: clean
- go test -count=1 ./internal/catalog ./internal/provider
./internal/codexcat: ok
- go test -run 'Effort|Level|Reason|Think|Codex.*Catalog|ModelsList'
./internal/agent ./internal/gateway: ok
- Against a copy of the real models.dev cache, every id in CPA's
internal/registry/models/models.json as a custom provider: the five
suffixed ids above now get their base's levels.
Not run: the full suite (machine at load ~190 with eight suites queued;
not holding the push). Not tried: a real CPA instance or the real
ChatGPT app.