From 4a41f770bb550904ff2150a69d7e194a1b11ea07 Mon Sep 17 00:00:00 2001 From: prakhar-endor Date: Wed, 12 Aug 2026 04:55:44 +0000 Subject: [PATCH] fixed codex windows unable to parse \n error --- agent-governance/scripts/render.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent-governance/scripts/render.sh b/agent-governance/scripts/render.sh index 643dfab..850c266 100755 --- a/agent-governance/scripts/render.sh +++ b/agent-governance/scripts/render.sh @@ -222,9 +222,9 @@ case "$agent:$target_os" in # As with Cursor on Windows, the EncodedCommand does not inherit the event # pipe, so each hook reads stdin and pipes it into endorctl; creds/envs are # inlined since Codex has no managed env block. - cmd_audit=$(psenc "$(printf '$ProgressPreference = "SilentlyContinue"\n$OutputEncoding = [System.Text.UTF8Encoding]::new($false)\n$in = if ([Console]::IsInputRedirected) { [System.IO.StreamReader]::new([Console]::OpenStandardInput(), $OutputEncoding).ReadToEnd() } else { "" }\n%s$in | %s --api %s --namespace %s --api-key %s --api-secret %s ai-audit codex; exit $LASTEXITCODE' \ + cmd_audit=$(psenc "$(printf '$ProgressPreference = "SilentlyContinue"\n$OutputEncoding = [System.Text.UTF8Encoding]::new($false)\n$in = if ([Console]::IsInputRedirected) { [System.IO.StreamReader]::new([Console]::OpenStandardInput(), $OutputEncoding).ReadToEnd() } else { "" }\n%s\n$in | %s --api %s --namespace %s --api-key %s --api-secret %s ai-audit codex; exit $LASTEXITCODE' \ "$ps_env_sets" "$ps_bin" "$(psq "$api_url")" "$(psq "$namespace")" "$(psq "$api_key")" "$(psq "$api_secret")")") - cmd_session=$(psenc "$(printf '$OutputEncoding = [System.Text.UTF8Encoding]::new($false)\n$in = [System.IO.StreamReader]::new([Console]::OpenStandardInput(), $OutputEncoding).ReadToEnd()\n%s\n%s$in | %s --api %s --namespace %s --api-key %s --api-secret %s ai-audit codex; exit $LASTEXITCODE' \ + cmd_session=$(psenc "$(printf '$OutputEncoding = [System.Text.UTF8Encoding]::new($false)\n$in = [System.IO.StreamReader]::new([Console]::OpenStandardInput(), $OutputEncoding).ReadToEnd()\n%s\n%s\n$in | %s --api %s --namespace %s --api-key %s --api-secret %s ai-audit codex; exit $LASTEXITCODE' \ "$boot" "$ps_env_sets" "$ps_bin" "$(psq "$api_url")" "$(psq "$namespace")" "$(psq "$api_key")" "$(psq "$api_secret")")") ;; esac