Use structured service tiers across core and app-server#20822
Use structured service tiers across core and app-server#20822aibrahim-oai wants to merge 22 commits into
Conversation
|
This change is part of the following stack: Change managed by git-spice. |
6310040 to
a01ae19
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a01ae19545
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
codex/codex-rs/tui/src/app_server_session.rs
Line 1048 in 023fdbd
ModelPreset.service_tiers
ModelPreset was changed to use service_tiers, but this constructor still initializes the removed additional_speed_tiers field. That leaves service_tiers unset and will fail to compile (unknown field / missing required field) when this module is built, blocking the TUI app-server session path.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4a5a23a58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .service_tier_id | ||
| .or(cfg.service_tier_id) | ||
| .or(deprecated_profile_service_tier) |
There was a problem hiding this comment.
Preserve profile precedence for deprecated service tier
Reorder fallback resolution so profile-level legacy service_tier still overrides root config. Current order checks cfg.service_tier_id before deprecated_profile_service_tier, so a global service_tier_id can unexpectedly override a selected profile’s legacy tier. This regresses prior layering semantics (profile > root) and can silently switch request tier for users with older profile keys.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0286377ed7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| #[serde(default)] | ||
| pub additional_speed_tiers: Vec<String>, | ||
| pub service_tiers: Vec<ModelServiceTier>, |
There was a problem hiding this comment.
Keep legacy
additional_speed_tiers deserializable
ModelInfo now only reads service_tiers. Cached /models payloads from prior versions still contain additional_speed_tiers; on cache load those entries are dropped and service_tiers defaults to empty. In offline/OnlineIfUncached flows this removes fast-tier metadata and changes behavior until a successful network refresh. Add a serde alias/migration path for the old key.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ede4afd5e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aef60ceb78
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Some(service_tier) => Some(service_tier.to_string()), | ||
| None => None, | ||
| }, | ||
| service_tier: service_tier.map(|service_tier| service_tier.to_string()), |
There was a problem hiding this comment.
Normalize legacy fast in runtime service-tier updates
ResponsesApiRequest now forwards service_tier verbatim. Turn-level overrides can carry ServiceTier("fast") directly and do not pass through Config::load normalization, so legacy fast can reach request construction unchanged. That creates inconsistent behavior versus config-based paths (which normalize to priority) and can bypass priority-based fast-mode handling.
| service_tier: service_tier.map(|service_tier| service_tier.to_string()), | |
| service_tier: service_tier.map(|service_tier| { | |
| if service_tier.as_ref() == "fast" { | |
| "priority".to_string() | |
| } else { | |
| service_tier.to_string() | |
| } | |
| }), |
Useful? React with 👍 / 👎.
Summary
ModelServiceTiermetadata to shared Codex model info, presets, and app-servermodel/listpayloads.ServiceTierstring-backed across config, session state, protocol ops, rollout/session events, app-server payloads, schemas, and generated SDK types.priorityandflex, while allowing backend-provided ids to pass through without app-server enum edits.priority.additionalSpeedTiersonly as deprecated app-server model-list metadata while clients move toserviceTiers.API impact
This intentionally changes app-server
serviceTierfrom a closed enum to a string-backed value. Existingfastandflexliterals are still accepted as strings, but clients should treat service-tier ids as backend-provided strings and read structured metadata fromserviceTiers.Verification