From cc50bc77ab7dca78a8677ba91eb23b73fc0f2616 Mon Sep 17 00:00:00 2001 From: David Wiesen Date: Tue, 7 Apr 2026 10:38:28 -0700 Subject: [PATCH] fix: apply PowerShell shell snapshots without profiles --- codex-rs/core/src/tools/runtimes/mod.rs | 115 ++++++++++++++-- codex-rs/core/src/tools/runtimes/mod_tests.rs | 129 ++++++++++++++++++ 2 files changed, 232 insertions(+), 12 deletions(-) diff --git a/codex-rs/core/src/tools/runtimes/mod.rs b/codex-rs/core/src/tools/runtimes/mod.rs index 99b5371f17..7d004e4283 100644 --- a/codex-rs/core/src/tools/runtimes/mod.rs +++ b/codex-rs/core/src/tools/runtimes/mod.rs @@ -7,6 +7,7 @@ small and focused and reuses the orchestrator for approvals + sandbox + retry. use crate::exec_env::CODEX_THREAD_ID_ENV_VAR; 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; @@ -37,18 +38,18 @@ 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", "