diff --git a/codex-rs/core/src/config/mod.rs b/codex-rs/core/src/config/mod.rs index a6c1166373..90f7d5c36f 100644 --- a/codex-rs/core/src/config/mod.rs +++ b/codex-rs/core/src/config/mod.rs @@ -3322,8 +3322,12 @@ impl Config { Vec::new(), ) }; - if enable_network_proxy && permission_profile.network_sandbox_policy().is_enabled() { - if let Some(network_proxy) = network_proxy_toml_config(cfg.features.as_ref()) { + if (enable_network_proxy || respect_system_proxy) + && permission_profile.network_sandbox_policy().is_enabled() + { + if enable_network_proxy + && let Some(network_proxy) = network_proxy_toml_config(cfg.features.as_ref()) + { apply_network_proxy_feature_config( &mut configured_network_proxy_config, network_proxy, @@ -4083,10 +4087,13 @@ impl Config { cfg.permissions.as_ref(), active_permission_profile.id.as_str(), )?; - if self.features.enabled(Feature::NetworkProxy) + let enable_network_proxy = self.features.enabled(Feature::NetworkProxy); + if (enable_network_proxy || self.respect_system_proxy) && permission_profile.network_sandbox_policy().is_enabled() { - if let Some(network_proxy) = network_proxy_toml_config(cfg.features.as_ref()) { + if enable_network_proxy + && let Some(network_proxy) = network_proxy_toml_config(cfg.features.as_ref()) + { apply_network_proxy_feature_config( &mut configured_network_proxy_config, network_proxy,