diff --git a/codex-rs/shell-command/src/command_safety/mod.rs b/codex-rs/shell-command/src/command_safety/mod.rs index 8c65079cee..3225841e08 100644 --- a/codex-rs/shell-command/src/command_safety/mod.rs +++ b/codex-rs/shell-command/src/command_safety/mod.rs @@ -1,3 +1,7 @@ +// Keep the PowerShell subprocess parser available as a test oracle, but do not +// compile it into production command classification. +#[cfg(test)] +#[allow(dead_code)] mod powershell_parser; mod powershell_tree_sitter; @@ -5,5 +9,4 @@ pub mod is_dangerous_command; pub mod is_safe_command; #[cfg(windows)] pub(crate) mod windows_safe_commands; -pub(crate) use powershell_parser::try_parse_powershell_ast_commands; pub(crate) use powershell_tree_sitter::try_parse_powershell_commands; diff --git a/codex-rs/shell-command/src/command_safety/windows_safe_commands.rs b/codex-rs/shell-command/src/command_safety/windows_safe_commands.rs index f7630ee6e3..3395108d23 100644 --- a/codex-rs/shell-command/src/command_safety/windows_safe_commands.rs +++ b/codex-rs/shell-command/src/command_safety/windows_safe_commands.rs @@ -1,5 +1,4 @@ -use crate::command_safety::powershell_parser::PowershellParseOutcome; -use crate::command_safety::powershell_parser::parse_with_powershell_ast; +use crate::command_safety::try_parse_powershell_commands; use std::path::Path; /// On Windows, we conservatively allow only clearly read-only PowerShell invocations @@ -92,14 +91,8 @@ fn parse_powershell_invocation(executable: &str, args: &[String]) -> Option' or pwsh.exe -Command: