Compare commits

...

1 Commits

Author SHA1 Message Date
Ahmed Ibrahim
a6dbb57e48 Remove live PowerShell discovery from shell handler test
Keep the shell handler regression test focused on command-shape safety by dropping the environment-sensitive PowerShell executable discovery paths that already have direct coverage in codex-shell-command.

Co-authored-by: Codex <noreply@openai.com>
2026-03-17 17:09:53 +00:00

View File

@@ -7,8 +7,6 @@ use pretty_assertions::assert_eq;
use crate::codex::make_session_and_context;
use crate::exec_env::create_env;
use crate::is_safe_command::is_known_safe_command;
use crate::powershell::try_find_powershell_executable_blocking;
use crate::powershell::try_find_pwsh_executable_blocking;
use crate::sandboxing::SandboxPermissions;
use crate::shell::Shell;
use crate::shell::ShellType;
@@ -34,24 +32,8 @@ fn commands_generated_by_shell_command_handler_can_be_matched_by_is_known_safe_c
shell_snapshot: crate::shell::empty_shell_snapshot_receiver(),
};
assert_safe(&zsh_shell, "ls -la");
if let Some(path) = try_find_powershell_executable_blocking() {
let powershell = Shell {
shell_type: ShellType::PowerShell,
shell_path: path.to_path_buf(),
shell_snapshot: crate::shell::empty_shell_snapshot_receiver(),
};
assert_safe(&powershell, "ls -Name");
}
if let Some(path) = try_find_pwsh_executable_blocking() {
let pwsh = Shell {
shell_type: ShellType::PowerShell,
shell_path: path.to_path_buf(),
shell_snapshot: crate::shell::empty_shell_snapshot_receiver(),
};
assert_safe(&pwsh, "ls -Name");
}
// PowerShell wrapper safety lives in codex-shell-command, which already
// covers real executable discovery and parser behavior directly.
}
fn assert_safe(shell: &Shell, command: &str) {