From 7781f0a5a80c29d23beccda7be027d6032bf31c8 Mon Sep 17 00:00:00 2001 From: Shijie Rao Date: Mon, 24 Aug 2026 16:41:33 +0000 Subject: [PATCH] Add a managed gate for in-app local automation (#40436) ## What changed - Register the stable, requirements-only `in_app_local_automation` feature for desktop apps. - Add the feature to the configuration schema. - Verify that an enterprise requirement can disable local automation. GitOrigin-RevId: 939f7f3ee15f662dc85589cd1bcc3838e4cd1287 --- codex-rs/core/config.schema.json | 6 ++++++ codex-rs/core/src/config/config_tests.rs | 22 ++++++++++++++++++++++ codex-rs/features/src/lib.rs | 10 ++++++++++ 3 files changed, 38 insertions(+) diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json index f8a17fe6d4..8e278bdcae 100644 --- a/codex-rs/core/config.schema.json +++ b/codex-rs/core/config.schema.json @@ -751,6 +751,9 @@ "in_app_dictation": { "type": "boolean" }, + "in_app_local_automation": { + "type": "boolean" + }, "in_app_updates": { "type": "boolean" }, @@ -5724,6 +5727,9 @@ "in_app_dictation": { "type": "boolean" }, + "in_app_local_automation": { + "type": "boolean" + }, "in_app_updates": { "type": "boolean" }, diff --git a/codex-rs/core/src/config/config_tests.rs b/codex-rs/core/src/config/config_tests.rs index b02140c861..cb5ce33086 100644 --- a/codex-rs/core/src/config/config_tests.rs +++ b/codex-rs/core/src/config/config_tests.rs @@ -11160,6 +11160,28 @@ in_app_dictation = false Ok(()) } +#[tokio::test] +async fn in_app_local_automation_feature_requirements_are_valid() -> std::io::Result<()> { + let codex_home = TempDir::new()?; + + let config = ConfigBuilder::without_managed_config_for_tests() + .codex_home(codex_home.path().to_path_buf()) + .cloud_config_bundle( + CloudConfigBundleFixture::loader_with_enterprise_requirement( + r#" +[features] +in_app_local_automation = false +"#, + ), + ) + .build() + .await?; + + assert!(!config.features.enabled(Feature::InAppLocalAutomation)); + + Ok(()) +} + #[tokio::test] async fn explicit_feature_config_is_normalized_by_requirements() -> std::io::Result<()> { let codex_home = TempDir::new()?; diff --git a/codex-rs/features/src/lib.rs b/codex-rs/features/src/lib.rs index af37ac20ad..50a8921ad8 100644 --- a/codex-rs/features/src/lib.rs +++ b/codex-rs/features/src/lib.rs @@ -219,6 +219,10 @@ pub enum Feature { /// /// Requirements-only gate: this should be set from requirements, not user config. InAppDictation, + /// Allow desktop apps to run local automations. + /// + /// Requirements-only gate: this should be set from requirements, not user config. + InAppLocalAutomation, /// Allow desktop apps to perform in-app updates. /// /// Requirements-only gate: this should be set from requirements, not user config. @@ -1253,6 +1257,12 @@ pub const FEATURES: &[FeatureSpec] = &[ stage: Stage::Stable, default_enabled: true, }, + FeatureSpec { + id: Feature::InAppLocalAutomation, + key: "in_app_local_automation", + stage: Stage::Stable, + default_enabled: true, + }, FeatureSpec { id: Feature::InAppUpdates, key: "in_app_updates",