From 420accf199e10bc908837ce5c7609b3bb9a38c8d Mon Sep 17 00:00:00 2001 From: sayan-oai Date: Sun, 9 Aug 2026 00:23:53 +0000 Subject: [PATCH] Use the step context for command approval prefix rules (#37641) ## What changed Read `allow_prefix_rules` from the turn attached to the active step context when selecting the exec policy and constructing unified exec approval requests. GitOrigin-RevId: d2d26e88b9cefa28bb2df5b9f71aa7b30b7ea331 --- codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs | 4 ++-- codex-rs/core/src/unified_exec/process_manager.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs b/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs index 139d8cd766..acc7ff82ee 100644 --- a/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs +++ b/codex-rs/core/src/tools/runtimes/shell/unix_escalation.rs @@ -176,7 +176,7 @@ pub(super) async fn try_run_zsh_fork( ctx.session .services .exec_policy - .current_for_prefix_rules(ctx.turn.allow_prefix_rules()) + .current_for_prefix_rules(ctx.step_context.turn.allow_prefix_rules()) .as_ref() .clone(), )); @@ -289,7 +289,7 @@ pub(crate) async fn prepare_unified_exec_zsh_fork( ctx.session .services .exec_policy - .current_for_prefix_rules(ctx.turn.allow_prefix_rules()) + .current_for_prefix_rules(ctx.step_context.turn.allow_prefix_rules()) .as_ref() .clone(), )); diff --git a/codex-rs/core/src/unified_exec/process_manager.rs b/codex-rs/core/src/unified_exec/process_manager.rs index 82c3cbd4b5..4a4c1ba1c1 100644 --- a/codex-rs/core/src/unified_exec/process_manager.rs +++ b/codex-rs/core/src/unified_exec/process_manager.rs @@ -1174,7 +1174,7 @@ impl UnifiedExecProcessManager { request.sandbox_permissions }, prefix_rule: request.prefix_rule.clone(), - allow_prefix_rules: context.turn.allow_prefix_rules(), + allow_prefix_rules: context.step_context.turn.allow_prefix_rules(), }) .await; let req = UnifiedExecToolRequest {