diff --git a/codex-rs/app-server/tests/suite/v2/compaction.rs b/codex-rs/app-server/tests/suite/v2/compaction.rs index 4730d920c..daf6030dd 100644 --- a/codex-rs/app-server/tests/suite/v2/compaction.rs +++ b/codex-rs/app-server/tests/suite/v2/compaction.rs @@ -29,7 +29,6 @@ use codex_app_server_protocol::TurnStartParams; use codex_app_server_protocol::TurnStartResponse; use codex_app_server_protocol::UserInput as V2UserInput; use codex_core::auth::AuthCredentialsStoreMode; -use codex_core::features::Feature; use codex_protocol::models::ContentItem; use codex_protocol::models::ResponseItem; use core_test_support::responses; @@ -143,12 +142,10 @@ async fn auto_compaction_remote_emits_started_and_completed_items() -> Result<() .await; let codex_home = TempDir::new()?; - let mut features = BTreeMap::default(); - features.insert(Feature::RemoteCompaction, true); write_mock_responses_config_toml( codex_home.path(), &server.uri(), - &features, + &BTreeMap::default(), AUTO_COMPACT_LIMIT, Some(true), "openai", diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json index e9ac1c3b8..1364152a4 100644 --- a/codex-rs/core/config.schema.json +++ b/codex-rs/core/config.schema.json @@ -199,9 +199,6 @@ "powershell_utf8": { "type": "boolean" }, - "remote_compaction": { - "type": "boolean" - }, "remote_models": { "type": "boolean" }, @@ -1232,9 +1229,6 @@ "powershell_utf8": { "type": "boolean" }, - "remote_compaction": { - "type": "boolean" - }, "remote_models": { "type": "boolean" }, diff --git a/codex-rs/core/src/codex.rs b/codex-rs/core/src/codex.rs index 572093d84..f1f0f3d54 100644 --- a/codex-rs/core/src/codex.rs +++ b/codex-rs/core/src/codex.rs @@ -3877,7 +3877,7 @@ pub(crate) async fn run_turn( } async fn run_auto_compact(sess: &Arc, turn_context: &Arc) { - if should_use_remote_compact_task(sess.as_ref(), &turn_context.provider) { + if should_use_remote_compact_task(&turn_context.provider) { run_inline_remote_auto_compact_task(Arc::clone(sess), Arc::clone(turn_context)).await; } else { run_inline_auto_compact_task(Arc::clone(sess), Arc::clone(turn_context)).await; diff --git a/codex-rs/core/src/compact.rs b/codex-rs/core/src/compact.rs index ab9a9f15d..72e002d45 100644 --- a/codex-rs/core/src/compact.rs +++ b/codex-rs/core/src/compact.rs @@ -9,7 +9,6 @@ use crate::codex::TurnContext; use crate::codex::get_last_assistant_message_from_turn; use crate::error::CodexErr; use crate::error::Result as CodexResult; -use crate::features::Feature; use crate::protocol::CompactedItem; use crate::protocol::EventMsg; use crate::protocol::TurnContextItem; @@ -34,11 +33,8 @@ pub const SUMMARIZATION_PROMPT: &str = include_str!("../templates/compact/prompt pub const SUMMARY_PREFIX: &str = include_str!("../templates/compact/summary_prefix.md"); const COMPACT_USER_MESSAGE_MAX_TOKENS: usize = 20_000; -pub(crate) fn should_use_remote_compact_task( - session: &Session, - provider: &ModelProviderInfo, -) -> bool { - provider.is_openai() && session.enabled(Feature::RemoteCompaction) +pub(crate) fn should_use_remote_compact_task(provider: &ModelProviderInfo) -> bool { + provider.is_openai() } pub(crate) async fn run_inline_auto_compact_task( diff --git a/codex-rs/core/src/config/service.rs b/codex-rs/core/src/config/service.rs index 72393f805..b72af4c0f 100644 --- a/codex-rs/core/src/config/service.rs +++ b/codex-rs/core/src/config/service.rs @@ -774,7 +774,7 @@ unified_exec = true service .write_value(ConfigValueWriteParams { file_path: Some(tmp.path().join(CONFIG_TOML_FILE).display().to_string()), - key_path: "features.remote_compaction".to_string(), + key_path: "features.remote_models".to_string(), value: serde_json::json!(true), merge_strategy: MergeStrategy::Replace, expected_version: None, @@ -794,7 +794,7 @@ hide_full_access_warning = true [features] unified_exec = true -remote_compaction = true +remote_models = true "#; assert_eq!(updated, expected); Ok(()) diff --git a/codex-rs/core/src/features.rs b/codex-rs/core/src/features.rs index ee091979e..22cb88f99 100644 --- a/codex-rs/core/src/features.rs +++ b/codex-rs/core/src/features.rs @@ -97,8 +97,6 @@ pub enum Feature { WindowsSandbox, /// Use the elevated Windows sandbox pipeline (setup + runner). WindowsSandboxElevated, - /// Remote compaction enabled (only for ChatGPT auth) - RemoteCompaction, /// Refresh remote models and emit AppReady once the list is available. RemoteModels, /// Experimental shell snapshotting. @@ -499,12 +497,6 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::UnderDevelopment, default_enabled: false, }, - FeatureSpec { - id: Feature::RemoteCompaction, - key: "remote_compaction", - stage: Stage::UnderDevelopment, - default_enabled: true, - }, FeatureSpec { id: Feature::RemoteModels, key: "remote_models", diff --git a/codex-rs/core/src/tasks/compact.rs b/codex-rs/core/src/tasks/compact.rs index e1fdbfd91..908b0460f 100644 --- a/codex-rs/core/src/tasks/compact.rs +++ b/codex-rs/core/src/tasks/compact.rs @@ -25,7 +25,7 @@ impl SessionTask for CompactTask { _cancellation_token: CancellationToken, ) -> Option { let session = session.clone_session(); - if crate::compact::should_use_remote_compact_task(session.as_ref(), &ctx.provider) { + if crate::compact::should_use_remote_compact_task(&ctx.provider) { let _ = session.services.otel_manager.counter( "codex.task.compact", 1, diff --git a/codex-rs/core/tests/suite/compact.rs b/codex-rs/core/tests/suite/compact.rs index ea9d2f92f..183732f0a 100644 --- a/codex-rs/core/tests/suite/compact.rs +++ b/codex-rs/core/tests/suite/compact.rs @@ -5,7 +5,6 @@ use codex_core::built_in_model_providers; use codex_core::compact::SUMMARIZATION_PROMPT; use codex_core::compact::SUMMARY_PREFIX; use codex_core::config::Config; -use codex_core::features::Feature; use codex_core::protocol::AskForApproval; use codex_core::protocol::EventMsg; use codex_core::protocol::ItemCompletedEvent; @@ -1464,7 +1463,6 @@ async fn auto_compact_runs_after_resume_when_token_usage_is_over_limit() { let mut builder = test_codex().with_config(move |config| { set_test_compact_prompt(config); config.model_auto_compact_token_limit = Some(limit); - config.features.enable(Feature::RemoteCompaction); }); let initial = builder.build(&server).await.unwrap(); let home = initial.home.clone(); @@ -1493,7 +1491,6 @@ async fn auto_compact_runs_after_resume_when_token_usage_is_over_limit() { let mut resume_builder = test_codex().with_config(move |config| { set_test_compact_prompt(config); config.model_auto_compact_token_limit = Some(limit); - config.features.enable(Feature::RemoteCompaction); }); let resumed = resume_builder .resume(&server, home, rollout_path) @@ -2290,7 +2287,6 @@ async fn auto_compact_counts_encrypted_reasoning_before_last_user() { .with_config(|config| { set_test_compact_prompt(config); config.model_auto_compact_token_limit = Some(300); - config.features.enable(Feature::RemoteCompaction); }) .build(&server) .await @@ -2411,7 +2407,6 @@ async fn auto_compact_runs_when_reasoning_header_clears_between_turns() { .with_config(|config| { set_test_compact_prompt(config); config.model_auto_compact_token_limit = Some(300); - config.features.enable(Feature::RemoteCompaction); }) .build(&server) .await diff --git a/codex-rs/core/tests/suite/compact_remote.rs b/codex-rs/core/tests/suite/compact_remote.rs index 435aa8900..a2ae58cf2 100644 --- a/codex-rs/core/tests/suite/compact_remote.rs +++ b/codex-rs/core/tests/suite/compact_remote.rs @@ -4,7 +4,6 @@ use std::fs; use anyhow::Result; use codex_core::CodexAuth; -use codex_core::features::Feature; use codex_core::protocol::EventMsg; use codex_core::protocol::ItemCompletedEvent; use codex_core::protocol::ItemStartedEvent; @@ -45,11 +44,7 @@ async fn remote_compact_replaces_history_for_followups() -> Result<()> { skip_if_no_network!(Ok(())); let harness = TestCodexHarness::with_builder( - test_codex() - .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) - .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); - }), + test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()), ) .await?; let codex = harness.test().codex.clone(); @@ -166,11 +161,7 @@ async fn remote_compact_runs_automatically() -> Result<()> { skip_if_no_network!(Ok(())); let harness = TestCodexHarness::with_builder( - test_codex() - .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) - .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); - }), + test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()), ) .await?; let codex = harness.test().codex.clone(); @@ -253,7 +244,6 @@ async fn remote_compact_trims_function_call_history_to_fit_context_window() -> R test_codex() .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); config.model_context_window = Some(2_000); }), ) @@ -384,7 +374,6 @@ async fn remote_compact_trim_estimate_uses_session_base_instructions() -> Result test_codex() .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); config.model_context_window = Some(200_000); }), ) @@ -482,7 +471,6 @@ async fn remote_compact_trim_estimate_uses_session_base_instructions() -> Result .with_config({ let override_base_instructions = override_base_instructions.clone(); move |config| { - config.features.enable(Feature::RemoteCompaction); config.model_context_window = Some(override_context_window); config.base_instructions = Some(override_base_instructions); } @@ -575,11 +563,7 @@ async fn remote_manual_compact_emits_context_compaction_items() -> Result<()> { skip_if_no_network!(Ok(())); let harness = TestCodexHarness::with_builder( - test_codex() - .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) - .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); - }), + test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()), ) .await?; let codex = harness.test().codex.clone(); @@ -671,11 +655,7 @@ async fn remote_compact_persists_replacement_history_in_rollout() -> Result<()> skip_if_no_network!(Ok(())); let harness = TestCodexHarness::with_builder( - test_codex() - .with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()) - .with_config(|config| { - config.features.enable(Feature::RemoteCompaction); - }), + test_codex().with_auth(CodexAuth::create_dummy_chatgpt_auth_for_testing()), ) .await?; let codex = harness.test().codex.clone();