Files
magpie/docs
yetone 167101d57a gateway: service_tier "fast" reaches a Codex account as Codex sends Fast, "priority" (Archivemylife on X)
Archivemylife on X sent a Responses request for gpt-6.1-sol on a Codex
account with "service_tier": "fast" and got "default" back. magpie
dropped the key: codexBody kept only "priority" and "ultrafast", and the
IR's Fast (Chat and Responses parse) is set by "priority" alone, so
"fast" never reached the ChatGPT backend on either API.

"fast" is Codex's own name for its Fast mode. Codex never sends it:
ServiceTier::from_request_value reads "fast" and "priority" alike as
Fast and request_value sends "priority" (openai/codex
codex-rs/protocol/src/config_types.rs; step_settings.rs normalizes the
legacy "fast" the same way; read at 7fb4014d5).

- handle() turns a top-level string service_tier "fast" into "priority"
  on Chat and Responses (fastTier), before the Codex and key tier
  settings, routing and tier_asked. Those settings still win: they are
  the user's own value. Other tiers, "Fast", nested or non-string
  values go as they came.
- codexBody sends "fast" as "priority" too, for any path that reaches
  it without the handler.
- Anthropic Messages: Claude's equivalent is speed "fast", already read
  as Fast and sent to the ChatGPT backend as priority (covered by the
  new test). Anthropic's own service_tier (auto/standard_only) is about
  capacity, not speed, and is not mapped.
- Not changed: "flex" (Codex's Flex) is still dropped for ChatGPT
  accounts, as before; responses.go untouched.

The backend's reply still says "auto" then "default" with priority
honoured (servedTierAt already knows this), so the client's response
service_tier is not proof either way; speed is.

Run:
- Red on the old code (production files from HEAD, tests new):
  TestFastTierWordReachesCodex red on Responses fast, whole fast, Chat
  fast, whole fast; TestCodexBodyServiceTier red on "fast". Green with
  the change.
- Real Pro ChatGPT account in a sandbox HOME (codex logins only,
  refresh tokens blanked, no agent config touched), binary built at
  this change, gpt-6.1-sol: Responses "fast" (whole and streamed), Chat
  "fast" and Messages speed "fast" each went out with tier priority
  (trace tries); "default" went with none. Streamed Responses reply said
  service_tier auto/default. Two pairs, 600-word essay, effort low:
  priority 28.3 and 30.1 tok/s, none 22.3 and 21.2 tok/s.
- mica: go test -count=1 -timeout 45m ./... at this tree: 103 ok, no
  FAIL. go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows
  go vet ./..., go build: ok. gofmt -l: empty. That tree was on
  be6f8b730; after rebasing onto 3f4372cc9 (a gateway change),
  internal/gateway (962s) and internal/provider ran ok again at this
  tree on mica. Rebased again onto c5f2a67d0 (routing.go, agy quota):
  go vet ./internal/gateway ./internal/provider and go test -run
  "Tier|Fast|Codex|Agy" on both packages ok at the pushed tree.

Not tried: a Plus account; Codex's own sign-in route (codexBackend),
where Codex itself never sends "fast".
2026-11-17 16:56:29 +08:00
..