mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
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:
@@ -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 {
|
||||
(
|
||||
|
||||
@@ -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 {
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user