Skip to content

fix: map service_tier fast → priority for Codex backend#277

Open
icebear0828 wants to merge 1 commit intomasterfrom
fix/service-tier-fast-priority
Open

fix: map service_tier fast → priority for Codex backend#277
icebear0828 wants to merge 1 commit intomasterfrom
fix/service-tier-fast-priority

Conversation

@icebear0828
Copy link
Copy Markdown
Owner

Summary

  • Codex Desktop (codex-rs client.rs:740) maps "fast""priority" before sending to the backend API
  • Our proxy was stripping service_tier entirely after receiving "Unsupported service_tier: fast" errors, making -fast models (e.g. gpt-5.4-fast) behave identically to standard ones
  • Now correctly maps fast→priority and passes other tiers (e.g. flex) as-is, for both HTTP SSE and WebSocket paths

Changes

  • src/proxy/codex-api.ts: Add mapServiceTier() helper, send mapped service_tier in both HTTP and WS request bodies
  • src/proxy/ws-transport.ts: Add service_tier to WsCreateRequest type
  • src/proxy/__tests__/codex-api-headers.test.ts: Update + add tests for fast→priority mapping, flex passthrough, and unset case

Test plan

  • Unit tests: 8/8 pass (codex-api-headers.test.ts)
  • Full suite: 1251/1251 pass
  • Real request: gpt-5.4-fast returns valid response through proxy
  • Run model-bench.ts to verify speed difference between fast and standard models

Codex Desktop (codex-rs client.rs:740) maps the user-facing "fast"
service tier to "priority" before sending to the backend API. Our proxy
was stripping service_tier entirely after receiving "Unsupported
service_tier: fast" errors, causing fast models (e.g. gpt-5.4-fast)
to behave identically to standard ones.

Now correctly maps fast→priority and passes other tiers (e.g. flex)
as-is, for both HTTP SSE and WebSocket paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant