Preserve target-native paths in command approvals (#42577)

## What changed

- Pass the selected executor's `PathUri` through user command approval requests instead of converting the working directory to a host-native path.
- Make native-path permission helpers explicitly local and require executor-aware permission transforms to receive a `FileSystemSandboxPolicyContext`.
- Cover approved remote commands to verify that the approval request reports the selected remote working directory and execution resumes after approval.

GitOrigin-RevId: 0aa3042f2d7594af6c7d0abf31d7f99cf67d5556
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-03 16:21:10 +00:00
1 parent 0650d6d1ca
commit 7a7c188682
30 files changed
+304 -368

No files matched your search

+1 -10
View File
@@ -708,15 +708,6 @@ impl Session {
proposed_execpolicy_amendment,
..
} => {
let cwd = match guardian_cwd(environment_id, cwd.clone()) {
Ok(cwd) => cwd,
Err(err) => {
tracing::error!(%err, "failed to resolve approval command cwd");
return ReviewDecision::denied(format!(
"failed to resolve approval command cwd: {err}"
));
}
};
let tool_name = "unified_exec";
let reason = ctx
.retry_reason
@@ -743,7 +734,7 @@ impl Session {
/*approval_id*/ None,
Some(environment_id.clone()),
command.clone(),
cwd.into(),
cwd.clone(),
reason,
ctx.network_approval_context.clone(),
proposed_execpolicy_amendment.clone(),