Honor client-resolved service tier defaults#23537
Conversation
| /// Toggle the opt-out marker for Codex-managed fast defaults. | ||
| SetNoticeFastDefaultOptOut(bool), |
There was a problem hiding this comment.
We are deprecating this notice
| default_input_modalities(), | ||
| ); | ||
| model.service_tiers = vec![ModelServiceTier { | ||
| id: ServiceTier::Fast.request_value().to_string(), |
There was a problem hiding this comment.
Capturing the service-tier fixture note here: ServiceTier::Fast is still a legacy compatibility variant, but ServiceTier::Fast.request_value() resolves to the actual catalog/request id (priority). We discussed spelling priority directly in catalog-shaped tests, but decided not to make that cleanup right now; the important invariant is that the generated id/default value remains priority, not literal fast.
| } | ||
| } | ||
|
|
||
| pub(crate) fn service_tier_update_for_core( |
There was a problem hiding this comment.
Open for better name - the effective_service_tier indicates what the user choice is and service_tier_update_for_core is what we actually provide to core for inferencing.
a7a2e86 to
ed7aa15
Compare
| if !fast_mode_enabled { | ||
| return None; |
There was a problem hiding this comment.
codex:
This early return seems too broad. It drops every configured tier when FastMode is disabled, including explicit flex, even though config parsing and existing tests still treat flex as a valid independent service tier. Should this only suppress managed/catalog Fast defaults, while preserving explicit supported tiers?
There was a problem hiding this comment.
I think if fast_mode is off, we should respect it no matter what service_tier is populated with.
There was a problem hiding this comment.
isn't this a feature flag that is always true?
There was a problem hiding this comment.
technically no - I think enterprise are using this to turn off the fast mode in general - we will do another pass to clean that up. I can work with you guys to figure that path forward.
| return None; | ||
| } | ||
|
|
||
| let effective = effective_service_tier(config, model, models); |
There was a problem hiding this comment.
codex:
This makes catalog-default resolution a TUI-side responsibility. AppServerSession benefits from it, but direct app-server callers that omit serviceTier still reach core with no resolved default. Should this live below the client layer so backend default_service_tier semantics apply consistently across all entrypoints?
but you mentioned offline that we are ok offloading this responsibility to clients like TUI and app and not doing it in core? double checking
There was a problem hiding this comment.
Ya I think that was a choice we made to intentionally have the responsibility sit with the client.
|
@aibrahim-oai Can you give this a read too? want to make sure you also understand the mechnism behind what we talked about. |
| #[serde(rename_all = "lowercase")] | ||
| #[strum(serialize_all = "lowercase")] | ||
| pub enum ServiceTier { | ||
| Default, |
There was a problem hiding this comment.
This one is deprecated, do we actually need to add default to it?
There was a problem hiding this comment.
Good point - let me get rid of this and will add a comment about deprecation here.
4babfe4 to
a77ebfa
Compare
a77ebfa to
c9d92b4
Compare
Why
Model catalog responses can now advertise a nullable
default_service_tierfor each model. Codex needs to preserve three distinct states all the way from config/app-server inputs to inference:default, meaning the user intentionally wants standard routingpriority,flex, or future tiersKeeping those states distinct prevents the UI from showing one tier while core sends another, especially after model switches or app-server
thread/start/turn/startupdates.What Changed
default_service_tierthrough model catalog protocol types, app-server model responses, generated schemas, model cache fixtures, and provider/model-manager conversions.defaultservice tier sentinel and normalized legacy config spelling sofastinconfig.tomlstill materializes as the runtime/request idpriority.serviceTier: nullpreserves explicit standard-routing intent by mapping todefaultinstead of internalNone.defaultbefore/v1/responses, without applying catalog defaults itself.Validation
CARGO_INCREMENTAL=0 cargo build -p codex-cliCARGO_INCREMENTAL=0 cargo test -p codex-app-server model_listcargo test -p codex-tui service_tiercargo test -p codex-protocol service_tier_for_requestcargo test -p codex-core get_service_tierRUST_MIN_STACK=8388608 CARGO_INCREMENTAL=0 cargo test -p codex-core service_tier