Commit Graph
1 Commits
Author SHA1 Message Date
yetone 708515245d agent, codex: the Codex CLI magpie is the provider of offers Fast on a provider's GPT model, as /v1/codex/models does (#1530, yulong-ge)
The standalone Codex CLI that names magpie its model_provider reads its
models from ~/.codex/magpie-models.json (model_catalog_json, which Codex
prefers over a provider's model_catalog_url). magpieModels() built that
file's models without OwnTier, Tiers or Fast, so every entry had
service_tiers: [] and Codex never registered /fast, while the gateway's
lists (CodexListed for the backend, CodexCatalog for /v1/codex/models)
did offer the tiers since 68aab298 (#1234).

- provider.CodexTiers is now the one place that decides those three
  fields from an Entry: a provider added by its address (OwnTier),
  another magpie's tiers (#1234), Fast on a group a ChatGPT account's GPT
  model is in. codexListed and magpieModels both call it, so the file and
  the gateway's lists can't drift apart again.

Run:
- TestCodexCatalogTiersReachDisk (new): connects Codex on sub/gpt-6.1-sol
  of a provider added by its address and checks magpie-models.json offers
  it priority/Fast, glm-4.6 nothing, and that the file's tiers equal
  /v1/codex/models' for every model. With the CodexTiers call taken out of
  magpieModels it fails: 'offers sub/gpt-6.1-sol "", want "priority:Fast "'.
- Real codex-cli 0.162.0, CODEX_HOME a sandbox copy of what the test
  writes (base_url pointed at a dead port): `codex debug models` lists
  sub/gpt-6.1-sol with service_tiers [priority Fast]; built from the old
  code, [].
- go test internal/agent, internal/provider, internal/codexcat;
  gofmt -l clean; go vet darwin/linux/windows on the touched packages;
  go test -tags nogui ./... under the queue lock.
Not tried against the reporter's relay.
2026-10-11 04:10:30 +08:00