fix: map service_tier fast → priority for Codex backend#277
Open
icebear0828 wants to merge 1 commit intomasterfrom
Open
fix: map service_tier fast → priority for Codex backend#277icebear0828 wants to merge 1 commit intomasterfrom
icebear0828 wants to merge 1 commit intomasterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
codex-rsclient.rs:740) maps"fast"→"priority"before sending to the backend APIservice_tierentirely after receiving"Unsupported service_tier: fast"errors, making-fastmodels (e.g.gpt-5.4-fast) behave identically to standard onesfast→priorityand passes other tiers (e.g.flex) as-is, for both HTTP SSE and WebSocket pathsChanges
src/proxy/codex-api.ts: AddmapServiceTier()helper, send mappedservice_tierin both HTTP and WS request bodiessrc/proxy/ws-transport.ts: Addservice_tiertoWsCreateRequesttypesrc/proxy/__tests__/codex-api-headers.test.ts: Update + add tests for fast→priority mapping, flex passthrough, and unset caseTest plan
codex-api-headers.test.ts)gpt-5.4-fastreturns valid response through proxymodel-bench.tsto verify speed difference between fast and standard models