test(hooks): use cmd for windows observer hook stop fixtures

The observer hook precedence tests only need an ASCII stdout fixture. Avoid Windows PowerShell as the test shell so the JSON stop/block payload reaches the hook parser reliably when stdout is piped.\n\nCo-authored-by: Codex <noreply@openai.com>
This commit is contained in:
viyatb-oai
2026-04-07 14:05:04 -07:00
parent 8110afae66
commit ccea133400
2 changed files with 8 additions and 8 deletions

View File

@@ -392,10 +392,10 @@ mod tests {
let marker_path = temp.path().join("project-ran");
let (shell_program, shell_args, stopping_command, project_command) = if cfg!(windows) {
(
"powershell.exe".to_string(),
vec!["-NoProfile".to_string(), "-Command".to_string()],
"Write-Output '{\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"$null = New-Item -ItemType File -Path project-ran -Force; Write-Output 'project context'".to_string(),
"cmd.exe".to_string(),
vec!["/D".to_string(), "/C".to_string()],
"echo {\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}".to_string(),
"type nul > project-ran && echo project context".to_string(),
)
} else {
(

View File

@@ -451,10 +451,10 @@ mod tests {
let marker_path = temp.path().join("project-ran");
let (shell_program, shell_args, stopping_command, project_command) = if cfg!(windows) {
(
"powershell.exe".to_string(),
vec!["-NoProfile".to_string(), "-Command".to_string()],
"Write-Output '{\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}'".to_string(),
"$null = New-Item -ItemType File -Path project-ran -Force; Write-Output 'project context'".to_string(),
"cmd.exe".to_string(),
vec!["/D".to_string(), "/C".to_string()],
"echo {\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}".to_string(),
"type nul > project-ran && echo project context".to_string(),
)
} else {
(