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
This commit is contained in:
sayan-oai
2026-08-09 00:29:14 +00:00
committed by copyberry
parent 266c6920d9
commit 420accf199
2 changed files with 3 additions and 3 deletions
@@ -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(),
));
@@ -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 {