Honor default service tier in Codex CLI#21909
Conversation
| /// `priority` or `flex`; legacy `fast` also works). Use `unset` to opt | ||
| /// out of the model catalog default service tier. |
There was a problem hiding this comment.
Did not want to use "default" because that is a real service tier on the backend and the behavior we are introducing here is not consistent. If we see "unset", we would pass null for service tier which feel wrong if we do it with "default".
There was a problem hiding this comment.
Alternatively I was thinking about introducing a separate boolean to track user intentional for not using defualt service tier prodvided by the backend but that feel fragile and hard to reasoning if user config state is incorrect.
| let account_plan_type = auth_manager | ||
| .auth_cached() | ||
| .and_then(|auth| auth.account_plan_type()); |
There was a problem hiding this comment.
Default service tier is now backend driven - we do not have to pick a service tier based on plan type anymore.
8b0451b to
2a792e2
Compare
| if !fast_mode_enabled { | ||
| return None; | ||
| } |
There was a problem hiding this comment.
Return early so that if fast_mode feature is disabled (still possible via cloud requirements for enterprise users), we will default to None.
Why
Codex can now receive
default_service_tierfrom the model catalog. The client should honor backend-owned model metadata for default priority routing instead of duplicating plan-specific rules locally. The client also needs a durable way to represent standard routing when a model has a catalog default, so turning Fast mode off does not get overwritten by that default on the next turn.What Changed
default_service_tierto shared model metadata and model presets, including cache/test fixtures and the Bedrock catalog shape.defaultServiceTierthrough app-server v2model/list, regenerated the JSON/TypeScript schema fixtures, and preserved the field when the TUI bootstraps from app-server models.ModelInfo::effective_service_tier(...)for local/session state andModelInfo::service_tier_for_request(...)for the Responses API request boundary.service_tier = "unset"sentinel so config/TUI state can explicitly opt out of catalog defaults while inference requests still omitservice_tier.Feature::FastMode; when FastMode is disabled, Codex does not apply a model default and only preserves explicit supported tiers orunset.unsetwhen the user turns an active tier off.Validation
cargo build -p codex-clicargo test -p codex-protocol service_tier --libcargo test -p codex-core get_service_tier --libcargo test -p codex-tui user_turn_sends_standard_override_after_fast_is_turned_off --libcargo test -p codex-app-server-protocolcargo test -p codex-app-server model_listcargo test -p codex-tui app_server_session --lib