mirror of
https://github.com/openai/codex.git
synced 2026-11-22 15:15:18 +00:00
Add managed policy for in-app updates (#35537)
## What changed - Add the stable, default-enabled `in_app_updates` requirements-only feature. - Allow administrators to disable in-app updates through `[features]` in `requirements.toml`. - Expose the policy through `configRequirements/read` and include it in the config schema. ## Testing - Verify that in-app updates are enabled by default and disabled by the managed requirement. - Verify that `configRequirements/read` returns the configured policy. GitOrigin-RevId: e9c7074b516fe58385fdf7dc8420c0109c0c3df6
This commit is contained in:
1 parent
18f50c9e62
commit
95637f7056
5 files changed
+88
-1
No files matched your search
@@ -32,6 +32,7 @@ use codex_config::loader::load_config_layers_state;
|
||||
use codex_config::loader::load_requirements_toml;
|
||||
use codex_config::test_support::CloudConfigBundleFixture;
|
||||
use codex_exec_server::LOCAL_FS;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::config_types::EnvironmentVariablePattern;
|
||||
use codex_protocol::config_types::TrustLevel;
|
||||
use codex_protocol::config_types::WebSearchMode;
|
||||
@@ -1350,6 +1351,43 @@ personality = true
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn system_requirements_control_in_app_updates() -> anyhow::Result<()> {
|
||||
let tmp = tempdir()?;
|
||||
let codex_home = tmp.path().join("home");
|
||||
tokio::fs::create_dir_all(&codex_home).await?;
|
||||
let cwd = AbsolutePathBuf::from_absolute_path(tmp.path())?;
|
||||
|
||||
let default_config = ConfigBuilder::default()
|
||||
.codex_home(codex_home.clone())
|
||||
.fallback_cwd(Some(cwd.to_path_buf()))
|
||||
.loader_overrides(LoaderOverrides::without_managed_config_for_tests())
|
||||
.build()
|
||||
.await?;
|
||||
assert!(default_config.features.enabled(Feature::InAppUpdates));
|
||||
|
||||
let requirements_path = tmp.path().join("requirements.toml");
|
||||
tokio::fs::write(
|
||||
&requirements_path,
|
||||
r#"
|
||||
[features]
|
||||
in_app_updates = false
|
||||
"#,
|
||||
)
|
||||
.await?;
|
||||
let mut overrides = LoaderOverrides::without_managed_config_for_tests();
|
||||
overrides.system_requirements_path = Some(requirements_path);
|
||||
let managed_config = ConfigBuilder::default()
|
||||
.codex_home(codex_home)
|
||||
.fallback_cwd(Some(cwd.to_path_buf()))
|
||||
.loader_overrides(overrides)
|
||||
.build()
|
||||
.await?;
|
||||
|
||||
assert!(!managed_config.features.enabled(Feature::InAppUpdates));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[tokio::test]
|
||||
async fn mdm_requirements_take_precedence_over_cloud_config_bundle() -> anyhow::Result<()> {
|
||||
|
||||
Reference in new issue
Block a user