E5: feed every Codex prompt on stdin instead of argv

Prompts went to Codex as one argv string ('codex exec "$(cat file)"'), which
fails over 32 KB on Windows (and over 128 KB on Linux, E2BIG) and mangles
quotes. Every codex exec site (outside-voice resolver, /codex review custom
instructions, challenge, consult new and resume) now runs 'codex exec -'
with the prepared prompt file on stdin; challenge and consult write the
prompt with a quoted heredoc so it is never shell-parsed. The bash-native
timeout watchdog (stock macOS) started the command in the background, which
gives it /dev/null as stdin; it now passes the caller's stdin through.

The 'byte for byte' dispatch test drops its old argv trailing-LF exception,
the consultation and autoplan fixtures follow the stdin form, and the static
site test requires stdin at every rendered codex exec.
This commit is contained in:
garrytan committed 2026-10-03 21:11:38 +00:00
1 parent ebab87bb11
commit e2f9e144c0
11 files changed
+77 -22

No files matched your search

+3 -1
View File
@@ -335,7 +335,9 @@ _gstack_codex_timeout_wrapper() {
# mirror timeout(1)'s exit-124 contract. The watchdog's stdout is
# detached so an early finish never blocks a caller's $(...) capture on
# the orphaned sleep.
"$@" &
# Without job control a background command's stdin is /dev/null; keep the
# caller's stdin so prompts fed with `codex exec -` arrive (#1674).
"$@" <&0 &
local _cmd_pid=$!
(
sleep "$_duration" && trap '' TERM && kill -TERM "$_cmd_pid" 2>/dev/null || exit 0 # best-effort: the command already exited, nothing to stop