From 8e6452722d6b195ff613291cf8977d0b304ce888 Mon Sep 17 00:00:00 2001 From: David Wiesen Date: Thu, 16 Apr 2026 03:07:39 -0700 Subject: [PATCH] Restore Windows shell snapshots in sandboxed PowerShell --- codex-rs/core/src/tools/runtimes/mod.rs | 125 +++++++++++++++--- codex-rs/core/src/tools/runtimes/mod_tests.rs | 67 ++++++++++ 2 files changed, 177 insertions(+), 15 deletions(-) diff --git a/codex-rs/core/src/tools/runtimes/mod.rs b/codex-rs/core/src/tools/runtimes/mod.rs index 53890a89b7..32a929e1bc 100644 --- a/codex-rs/core/src/tools/runtimes/mod.rs +++ b/codex-rs/core/src/tools/runtimes/mod.rs @@ -6,6 +6,7 @@ small and focused and reuses the orchestrator for approvals + sandbox + retry. */ use crate::path_utils; use crate::shell::Shell; +use crate::shell::ShellType; use crate::tools::sandboxing::ToolError; use codex_protocol::models::PermissionProfile; use codex_sandboxing::SandboxCommand; @@ -36,28 +37,26 @@ pub(crate) fn build_sandbox_command( }) } -/// POSIX-only helper: for commands produced by `Shell::derive_exec_args` -/// for Bash/Zsh/sh of the form `[shell_path, "-lc", "