|
| 1 | +diff --git a/codex-rs/core/src/session/step_context.rs b/codex-rs/core/src/session/step_context.rs |
| 2 | +index ef2ed3ad924bfb95d245ed155215c919859b8480..f3e6d4018a1ad40a96e75e2234eda6c3e6f71df2 100644 |
| 3 | +--- a/codex-rs/core/src/session/step_context.rs |
| 4 | ++++ b/codex-rs/core/src/session/step_context.rs |
| 5 | +@@ -119,11 +119,26 @@ impl StepContext { |
| 6 | + let reasoning_effort = effort |
| 7 | + .or(model.default_reasoning_level.as_ref()) |
| 8 | + .map(|effort| model.resolve_reasoning_effort(effort.clone())); |
| 9 | ++ let local_network = if seed.strict_executor_writes && self.turn.network.is_some() { |
| 10 | ++ self.turn |
| 11 | ++ .config |
| 12 | ++ .permissions |
| 13 | ++ .network |
| 14 | ++ .as_ref() |
| 15 | ++ .map(crate::config::NetworkProxySpec::environment_policy) |
| 16 | ++ .filter(|policy| policy.requires_proxy) |
| 17 | ++ } else { |
| 18 | ++ None |
| 19 | ++ }; |
| 20 | + let executors = self |
| 21 | + .environments |
| 22 | + .turn_environments() |
| 23 | + .filter_map(|env| { |
| 24 | +- sdk_executor_policy_receipt(&env.selection, env.environment.is_remote()) |
| 25 | ++ sdk_executor_policy_receipt( |
| 26 | ++ &env.selection, |
| 27 | ++ env.environment.is_remote(), |
| 28 | ++ local_network.as_ref(), |
| 29 | ++ ) |
| 30 | + }) |
| 31 | + .collect::<Vec<_>>(); |
| 32 | + let user_config_applied = self |
| 33 | +diff --git a/codex-rs/protocol/src/environment.rs b/codex-rs/protocol/src/environment.rs |
| 34 | +index 93443249595270ed0c5509eee3b2eb14134a66bd..37687bfed91cdf6a6ea27b2df68a57dabf09d95a 100644 |
| 35 | +--- a/codex-rs/protocol/src/environment.rs |
| 36 | ++++ b/codex-rs/protocol/src/environment.rs |
| 37 | +@@ -106,6 +106,7 @@ impl std::fmt::Debug for EnvironmentConfig { |
| 38 | + pub fn sdk_executor_policy_receipt( |
| 39 | + selection: &TurnEnvironmentSelection, |
| 40 | + remote: bool, |
| 41 | ++ local_session_policy: Option<&EnvironmentNetworkPolicy>, |
| 42 | + ) -> Option<serde_json::Value> { |
| 43 | + let EnvironmentConfigState::Ready(config) = &selection.config else { |
| 44 | + return None; |
| 45 | +@@ -120,7 +121,12 @@ pub fn sdk_executor_policy_receipt( |
| 46 | + _ => None, |
| 47 | + }) |
| 48 | + .collect::<Vec<_>>(); |
| 49 | +- let network_policy = config.network_policy.as_ref().map(|policy| { |
| 50 | ++ let network_policy = if remote { |
| 51 | ++ config.network_policy.as_ref() |
| 52 | ++ } else { |
| 53 | ++ local_session_policy |
| 54 | ++ }; |
| 55 | ++ let network_policy = network_policy.map(|policy| { |
| 56 | + serde_json::json!({ |
| 57 | + "requires_proxy": policy.requires_proxy, |
| 58 | + "domains": policy.domains, |
0 commit comments