2- Use string service tiers in session protocol#20971
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6525e8fe2c
ℹ️ 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: 91466575b4
ℹ️ 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".
Preserve arbitrary service tier request ids through app-server thread config overrides instead of parsing them through the legacy enum. This keeps custom tier ids intact while still mapping legacy config enum values into request strings. Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fdfd9c4f3d
ℹ️ 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".
| lock_config.service_tier = sc | ||
| .service_tier | ||
| .as_deref() | ||
| .and_then(codex_protocol::config_types::ServiceTier::from_request_value); |
There was a problem hiding this comment.
Preserve service tier id when writing config lockfiles
save_session_resolved_fields narrows sc.service_tier through ServiceTier::from_request_value, so any non-priority/flex value (including legacy "fast") is serialized as None. That contradicts the function’s goal of making lockfiles self-contained and causes resumed sessions from lockfiles to silently lose their tier override.
Useful? React with 👍 / 👎.
Clone the string service tier from turn context before passing it into remote compaction request streaming. Co-authored-by: Codex <noreply@openai.com>
09eea74 to
bbc6667
Compare
There was a problem hiding this comment.
💡 Codex Review
After Op::OverrideTurnContext.service_tier changed to Option<Option<String>>, this pattern still matches ServiceTier::Fast. The TUI test target will fail to compile with a String-vs-ServiceTier type mismatch, breaking cargo test -p codex-tui.
ℹ️ 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".
Update the fast keybinding test to match string service tier request ids after OverrideTurnContext stopped carrying the config enum. Co-authored-by: Codex <noreply@openai.com>
Clone the service tier override for app-server validation before moving it into the submitted turn operation. Co-authored-by: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26348bc0b9
ℹ️ 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".
| let service_tier = match service_tier { | ||
| Some(ServiceTier::Fast) if features.enabled(Feature::FastMode) => { | ||
| Some(ServiceTier::Fast) | ||
| Some(service_tier) if service_tier == ServiceTier::Fast.request_value() => { |
There was a problem hiding this comment.
Normalize legacy fast tiers before forwarding
The previous v2 schema serialized ServiceTier::Fast as "fast", so existing clients/rollouts can still send that value. This new string path only recognizes "priority" as fast; "fast" falls through as a custom tier and is later sent unchanged to the Responses API, bypassing the FastMode gate and likely requesting an invalid tier. Normalize "fast" to "priority" or reject it explicitly.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 903ab728aa
ℹ️ 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".
| if let Some(service_tier) = updates.service_tier.clone() { | ||
| next_configuration.service_tier = service_tier; |
There was a problem hiding this comment.
Normalize legacy fast tiers on turn overrides
Fresh evidence: thread startup now normalizes "fast" through Config, but turn/start stores the raw string in session state. Existing v2 clients can still send the old enum value "fast"; this assignment makes later model requests forward service_tier: "fast" directly instead of "priority", bypassing the fast-mode gate and likely requesting an invalid tier.
Useful? React with 👍 / 👎.
3176b54 to
d36ff31
Compare
39d018e to
5a1a2a4
Compare
There was a problem hiding this comment.
💡 Codex Review
Config.service_tier is changed to Option<String>, but this test helper still assigns Some(service_tier) where service_tier is a ServiceTier. Any cargo test that compiles compact_remote.rs now fails with a type mismatch, blocking the core test suite.
ℹ️ 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".
bb13258 to
464407e
Compare
Break service tier session, operation, and app-server protocol fields from the closed enum to string tier ids. Send service tier strings through model requests, prewarm, compaction, memories, and TUI/app-server turn starts. Regenerate app-server protocol JSON and TypeScript schemas without the standalone ServiceTier TS enum. Co-authored-by: Codex <noreply@openai.com>
Avoid storing the normalized service tier twice on TurnContext. The per-turn Config already carries the request value, including review turns cloned from the parent context, so model requests can read it from there. Co-authored-by: Codex <noreply@openai.com>
Update remaining sampling callsites to read the normalized service tier from the per-turn Config after removing the duplicate TurnContext field. Co-authored-by: Codex <noreply@openai.com>
Clone the normalized service tier string when building remote compaction request settings from shared turn config. Co-authored-by: Codex <noreply@openai.com>
Use the normalized service tier request value when configuring remote compact test fixtures. Co-authored-by: Codex <noreply@openai.com>
Give the guardian parallel review test more headroom in the dedicated test thread after repeated Windows stack overflows in CI. Co-authored-by: Codex <noreply@openai.com>
64c8340 to
b3217b8
Compare
Summary
Verification