app-server service tier plumbing (plus some cleanup) (#13334)

followup to https://github.com/openai/codex/pull/13212 to expose fast
tier controls to app server
(majority of this PR is generated schema jsons - actual code is +69 /
-35 and +24 tests )

- add service tier fields to the app-server protocol surfaces used by
thread lifecycle, turn start, config, and session configured events
- thread service tier through the app-server message processor and core
thread config snapshots
- allow runtime config overrides to carry service tier for app-server
callers

cleanup:
- Removing useless "legacy" code supporting "standard" - we moved to
None | "fast", so "standard" is not needed.
This commit is contained in:
pash-openai
2026-03-03 02:35:09 -08:00
committed by GitHub
parent 938c6dd388
commit 07e532dcb9
47 changed files with 689 additions and 61 deletions

View File

@@ -1565,6 +1565,7 @@ pub struct ConfigOverrides {
pub approval_policy: Option<AskForApproval>,
pub sandbox_mode: Option<SandboxMode>,
pub model_provider: Option<String>,
pub service_tier: Option<Option<ServiceTier>>,
pub config_profile: Option<String>,
pub codex_linux_sandbox_exe: Option<PathBuf>,
pub main_execve_wrapper_exe: Option<PathBuf>,
@@ -1695,6 +1696,7 @@ impl Config {
approval_policy: approval_policy_override,
sandbox_mode,
model_provider,
service_tier: service_tier_override,
config_profile: config_profile_key,
codex_linux_sandbox_exe,
main_execve_wrapper_exe,
@@ -1956,10 +1958,12 @@ impl Config {
let model = model.or(config_profile.model).or(cfg.model);
let service_tier = if features.enabled(Feature::FastMode) {
config_profile
.service_tier
.or(cfg.service_tier)
.filter(|tier| matches!(tier, ServiceTier::Fast))
service_tier_override.unwrap_or_else(|| {
config_profile
.service_tier
.or(cfg.service_tier)
.filter(|tier| matches!(tier, ServiceTier::Fast))
})
} else {
None
};
@@ -5655,33 +5659,6 @@ trust_level = "untrusted"
Ok(())
}
#[test]
fn legacy_standard_service_tier_loads_as_default_none() -> anyhow::Result<()> {
let codex_home = TempDir::new()?;
let cfg = toml::from_str::<ConfigToml>(
r#"
service_tier = "standard"
[features]
fast_mode = true
"#,
)
.expect("TOML deserialization should succeed");
let config = Config::load_from_base_config_with_overrides(
cfg,
ConfigOverrides {
cwd: Some(codex_home.path().to_path_buf()),
..Default::default()
},
codex_home.path().to_path_buf(),
)?;
assert_eq!(config.service_tier, None);
Ok(())
}
#[test]
fn derive_sandbox_policy_falls_back_to_constraint_value_for_implicit_defaults()
-> anyhow::Result<()> {