From 84c8e21b319a15ef52e77cc0d358a2a97e5392df Mon Sep 17 00:00:00 2001 From: starr-openai Date: Tue, 5 May 2026 15:26:29 -0700 Subject: [PATCH] Fix environments TOML lint coverage Co-authored-by: Codex --- codex-rs/exec-server/src/environment_toml.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/codex-rs/exec-server/src/environment_toml.rs b/codex-rs/exec-server/src/environment_toml.rs index 5907b0a172..cbbd01ff53 100644 --- a/codex-rs/exec-server/src/environment_toml.rs +++ b/codex-rs/exec-server/src/environment_toml.rs @@ -46,7 +46,7 @@ struct TomlEnvironmentProvider { impl TomlEnvironmentProvider { fn new(config: EnvironmentsToml) -> Result { - Self::new_with_config_dir(config, None) + Self::new_with_config_dir(config, /*config_dir*/ None) } fn new_with_config_dir( @@ -670,4 +670,18 @@ default = "none" assert!(environments.contains_key(LOCAL_ENVIRONMENT_ID)); assert_eq!(provider.default_environment_id(), None); } + + #[tokio::test] + async fn environment_provider_from_codex_home_falls_back_when_file_is_missing() { + let codex_home = tempdir().expect("tempdir"); + + let provider = + environment_provider_from_codex_home(codex_home.path()).expect("environment provider"); + + let environments = provider + .get_environments(&test_runtime_paths()) + .expect("environments"); + + assert!(environments.contains_key(LOCAL_ENVIRONMENT_ID)); + } }