Skip to content

2- Use string service tiers in session protocol#20971

Merged
aibrahim-oai merged 6 commits intomainfrom
aibrahim/2-service-tier-string-op
May 6, 2026
Merged

2- Use string service tiers in session protocol#20971
aibrahim-oai merged 6 commits intomainfrom
aibrahim/2-service-tier-string-op

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

Summary

  • break service tier session/op/app-server protocol fields from the closed enum to string tier ids
  • send the service tier string directly through model requests, prewarm, compaction, memories, and TUI/app-server turn starts
  • regenerate app-server protocol JSON/TypeScript schemas, removing the standalone ServiceTier TS enum

Verification

  • just fmt
  • cargo check -p codex-core -p codex-app-server -p codex-tui
  • just write-app-server-schema

@aibrahim-oai aibrahim-oai requested a review from a team as a code owner May 4, 2026 09:13
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread codex-rs/app-server/src/codex_message_processor.rs Outdated
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread codex-rs/app-server/src/codex_message_processor.rs Outdated
aibrahim-oai added a commit that referenced this pull request May 4, 2026
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>
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +112 to +115
lock_config.service_tier = sc
.service_tier
.as_deref()
.and_then(codex_protocol::config_types::ServiceTier::from_request_value);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Base automatically changed from aibrahim/model-service-tiers to main May 5, 2026 06:51
aibrahim-oai added a commit that referenced this pull request May 5, 2026
Clone the string service tier from turn context before passing it into remote compaction request streaming.

Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/2-service-tier-string-op branch from 09eea74 to bbc6667 Compare May 5, 2026 07:12
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

service_tier: Some(Some(ServiceTier::Fast)),

P1 Badge Update stale service-tier pattern in fast toggle test

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".

aibrahim-oai added a commit that referenced this pull request May 5, 2026
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>
aibrahim-oai added a commit that referenced this pull request May 5, 2026
Clone the service tier override for app-server validation before moving it into the submitted turn operation.

Co-authored-by: Codex <noreply@openai.com>
@aibrahim-oai aibrahim-oai enabled auto-merge (squash) May 5, 2026 16:20
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread codex-rs/core/src/config/mod.rs Outdated
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() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread codex-rs/core/src/session/session.rs Outdated
Comment on lines 183 to 184
if let Some(service_tier) = updates.service_tier.clone() {
next_configuration.service_tier = service_tier;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@aibrahim-oai aibrahim-oai force-pushed the aibrahim/2-service-tier-string-op branch from 3176b54 to d36ff31 Compare May 6, 2026 10:21
@aibrahim-oai aibrahim-oai disabled auto-merge May 6, 2026 12:10
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/2-service-tier-string-op branch from 39d018e to 5a1a2a4 Compare May 6, 2026 12:17
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

config.service_tier = Some(service_tier);

P1 Badge Convert compact test service tier to string

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".

@aibrahim-oai aibrahim-oai force-pushed the aibrahim/2-service-tier-string-op branch from bb13258 to 464407e Compare May 6, 2026 13:32
aibrahim-oai and others added 6 commits May 6, 2026 17:27
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>
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/2-service-tier-string-op branch from 64c8340 to b3217b8 Compare May 6, 2026 14:29
@aibrahim-oai aibrahim-oai merged commit be1d3cf into main May 6, 2026
26 checks passed
@aibrahim-oai aibrahim-oai deleted the aibrahim/2-service-tier-string-op branch May 6, 2026 15:00
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants