diff --git a/codex-rs/features/src/lib.rs b/codex-rs/features/src/lib.rs index ce1ee6940e..ac40041bcd 100644 --- a/codex-rs/features/src/lib.rs +++ b/codex-rs/features/src/lib.rs @@ -174,7 +174,8 @@ pub enum Feature { RemotePlugin, /// Enable remote plugin sharing flows. PluginSharing, - /// Show the startup prompt for migrating external agent config into Codex. + /// Removed compatibility flag retained as a no-op now that external agent + /// migration is always offered during onboarding. ExternalMigration, /// Allow the model to invoke the built-in image generation tool. ImageGeneration, @@ -451,6 +452,9 @@ impl Features { "plugin_hooks" => { continue; } + "external_migration" => { + continue; + } "skill_env_var_dependency_prompt" => { continue; } @@ -1062,11 +1066,7 @@ pub const FEATURES: &[FeatureSpec] = &[ FeatureSpec { id: Feature::ExternalMigration, key: "external_migration", - stage: Stage::Experimental { - name: "External migration", - menu_description: "Show a startup prompt when Codex detects migratable external agent config for this machine or project.", - announcement: "", - }, + stage: Stage::Removed, default_enabled: false, }, FeatureSpec { diff --git a/codex-rs/features/src/tests.rs b/codex-rs/features/src/tests.rs index 5d7087e90b..4962ac9532 100644 --- a/codex-rs/features/src/tests.rs +++ b/codex-rs/features/src/tests.rs @@ -102,20 +102,13 @@ fn guardian_approval_is_stable_and_enabled_by_default() { } #[test] -fn external_migration_is_experimental_and_disabled_by_default() { - let spec = Feature::ExternalMigration.info(); - let stage = spec.stage; - - assert!(matches!(stage, Stage::Experimental { .. })); - assert_eq!(stage.experimental_menu_name(), Some("External migration")); - assert_eq!( - stage.experimental_menu_description(), - Some( - "Show a startup prompt when Codex detects migratable external agent config for this machine or project." - ) - ); - assert_eq!(stage.experimental_announcement(), None); +fn external_migration_is_removed_and_disabled_by_default() { + assert_eq!(Feature::ExternalMigration.stage(), Stage::Removed); assert_eq!(Feature::ExternalMigration.default_enabled(), false); + assert_eq!( + feature_for_key("external_migration"), + Some(Feature::ExternalMigration) + ); } #[test] @@ -530,6 +523,23 @@ fn from_sources_ignores_removed_plugin_hooks_feature_key() { assert_eq!(features, Features::with_defaults()); } +#[test] +fn from_sources_ignores_removed_external_migration_feature_key() { + let features_toml = + FeaturesToml::from(BTreeMap::from([("external_migration".to_string(), true)])); + + let features = Features::from_sources( + FeatureConfigSource { + features: Some(&features_toml), + ..Default::default() + }, + FeatureConfigSource::default(), + FeatureOverrides::default(), + ); + + assert_eq!(features, Features::with_defaults()); +} + #[test] fn multi_agent_v2_feature_config_deserializes_boolean_toggle() { let features: FeaturesToml = toml::from_str( diff --git a/codex-rs/tui/src/external_agent_config_migration_startup.rs b/codex-rs/tui/src/external_agent_config_migration_startup.rs index 3ec2ca3903..5ed8b4f6ce 100644 --- a/codex-rs/tui/src/external_agent_config_migration_startup.rs +++ b/codex-rs/tui/src/external_agent_config_migration_startup.rs @@ -9,7 +9,6 @@ use crate::legacy_core::config::edit::ConfigEditsBuilder; use crate::tui; use codex_app_server_protocol::ExternalAgentConfigDetectParams; use codex_app_server_protocol::ExternalAgentConfigMigrationItem; -use codex_features::Feature; use color_eyre::eyre::Result; use color_eyre::eyre::WrapErr; use std::collections::BTreeSet; @@ -25,11 +24,8 @@ pub(crate) enum ExternalAgentConfigMigrationStartupOutcome { ExitRequested, } -fn should_show_external_agent_config_migration_prompt( - config: &Config, - entered_trust_nux: bool, -) -> bool { - entered_trust_nux && config.features.enabled(Feature::ExternalMigration) +fn should_show_external_agent_config_migration_prompt(entered_trust_nux: bool) -> bool { + entered_trust_nux } fn external_config_migration_project_key(path: &Path) -> String { @@ -250,7 +246,7 @@ pub(crate) async fn handle_external_agent_config_migration_prompt_if_needed( harness_overrides: &ConfigOverrides, entered_trust_nux: bool, ) -> Result { - if !should_show_external_agent_config_migration_prompt(config, entered_trust_nux) { + if !should_show_external_agent_config_migration_prompt(entered_trust_nux) { return Ok(ExternalAgentConfigMigrationStartupOutcome::Continue { success_message: None, }); @@ -547,21 +543,13 @@ mod tests { assert_eq!(message, "External config migration completed successfully."); } - #[tokio::test] - async fn external_agent_config_migration_prompt_requires_trust_nux_entry() { - let codex_home = tempdir().expect("temp codex home"); - let mut config = ConfigBuilder::default() - .codex_home(codex_home.path().to_path_buf()) - .build() - .await - .expect("config"); - let _ = config.features.enable(Feature::ExternalMigration); - + #[test] + fn external_agent_config_migration_prompt_depends_only_on_trust_nux_entry() { assert!(!should_show_external_agent_config_migration_prompt( - &config, /*entered_trust_nux*/ false, + /*entered_trust_nux*/ false, )); assert!(should_show_external_agent_config_migration_prompt( - &config, /*entered_trust_nux*/ true, + /*entered_trust_nux*/ true, )); } }