Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Add managed gates for in-app chat and dictation (#39045)

Shijie Rao06418909a035
diff --git a/codex-rs/core/config.schema.json b/codex-rs/core/config.schema.json
index 7cd8e0726e..51fb16e0d4 100644
--- a/codex-rs/core/config.schema.json
+++ b/codex-rs/core/config.schema.json
@@ -603,6 +603,12 @@
"in_app_browser": {
"type": "boolean"
},
+ "in_app_chat": {
+ "type": "boolean"
+ },
+ "in_app_dictation": {
+ "type": "boolean"
+ },
"in_app_updates": {
"type": "boolean"
},
@@ -5382,6 +5388,12 @@
"in_app_browser": {
"type": "boolean"
},
+ "in_app_chat": {
+ "type": "boolean"
+ },
+ "in_app_dictation": {
+ "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 ad2be3291c..77513d8202 100644
--- a/codex-rs/core/src/config/config_tests.rs
+++ b/codex-rs/core/src/config/config_tests.rs
@@ -10655,6 +10655,50 @@ browser_use_full_cdp_access = false
Ok(())
}
+#[tokio::test]
+async fn in_app_chat_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_chat = false
+"#,
+ ),
+ )
+ .build()
+ .await?;
+
+ assert!(!config.features.enabled(Feature::InAppChat));
+
+ Ok(())
+}
+
+#[tokio::test]
+async fn in_app_dictation_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_dictation = false
+"#,
+ ),
+ )
+ .build()
+ .await?;
+
+ assert!(!config.features.enabled(Feature::InAppDictation));
+
+ 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 ea07f80cba..7a25605246 100644
--- a/codex-rs/features/src/lib.rs
+++ b/codex-rs/features/src/lib.rs
@@ -206,6 +206,14 @@ pub enum Feature {
///
/// Requirements-only gate: this should be set from requirements, not user config.
InAppBrowser,
+ /// Allow the in-app chat pane in desktop apps.
+ ///
+ /// Requirements-only gate: this should be set from requirements, not user config.
+ InAppChat,
+ /// Allow in-app dictation in desktop apps.
+ ///
+ /// Requirements-only gate: this should be set from requirements, not user config.
+ InAppDictation,
/// Allow desktop apps to perform in-app updates.
///
/// Requirements-only gate: this should be set from requirements, not user config.
@@ -1210,6 +1218,18 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::Stable,
default_enabled: true,
},
+ FeatureSpec {
+ id: Feature::InAppChat,
+ key: "in_app_chat",
+ stage: Stage::Stable,
+ default_enabled: true,
+ },
+ FeatureSpec {
+ id: Feature::InAppDictation,
+ key: "in_app_dictation",
+ stage: Stage::Stable,
+ default_enabled: true,
+ },
FeatureSpec {
id: Feature::InAppUpdates,
key: "in_app_updates",