Skip to content

[CI only] upstream #8390: fix(codex): use argv-safe POSIX hook commands - #15

Closed
bbingz wants to merge 5 commits into
mainfrom
fix/codex-hooks-argv-safe-posix
Closed

bbingz wants to merge 5 commits into
mainfrom
fix/codex-hooks-argv-safe-posix

Conversation

@bbingz

@bbingz bbingz commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Exact-head CI verification for stablyai#8390. This PR is not intended to merge and will be closed after checks complete.

bbingz and others added 5 commits July 12, 2026 19:21
Codex direct-execs hooks.json commands via argv split, not a shell.
wrapPosixHookCommand's if/then/fi guard became argv0=`if` → exit 127 and
Broken pipe on every managed hook (stablyai#8110). Emit `/bin/sh '<path>'` for
Codex local/WSL/SSH installs, keep the guarded wrapper for shell-based
agents, and still recognize legacy guarded trust hashes on remove.

Co-Authored-By: Claude <noreply@anthropic.com>
Current Codex launches hooks via $SHELL -lc with the full command as one
arg, so if/then/fi would work — but stablyai#8110's 127 also matches pure
whitespace argv-exec (argv0=`if`) and quoted `/bin/sh 'path'` fails that
model because quotes stay in the path token. Emit unquoted
`/bin/sh <path>` when the path is argv-safe; fall back to single-quoted
paths for spaces/metacharacters. Keep legacy trust variants for remove.

Co-Authored-By: Claude <noreply@anthropic.com>
…0-current

# Conflicts:
#	src/main/codex/hook-service-wsl-runtime.test.ts
#	src/main/codex/hook-service.ts
@bbingz bbingz closed this Jul 13, 2026
@bbingz
bbingz deleted the fix/codex-hooks-argv-safe-posix branch August 1, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant