fix(codex-implementer): make the timeout wrapper work under zsh - #12
Open
wooter wants to merge 1 commit into
Open
fix(codex-implementer): make the timeout wrapper work under zsh#12wooter wants to merge 1 commit into
wooter wants to merge 1 commit into
Conversation
This was referenced Aug 10, 2026
`${T:+$T 600} codex exec ...` relies on bash word-splitting an unquoted
parameter expansion. zsh does not word-split unquoted expansions, so
"$T 600" reaches execve as a single argv word and the run dies with:
no such file or directory: /opt/homebrew/bin/gtimeout 600
The Claude Code Bash tool runs zsh on macOS, which is where this lane
mostly lives, so the timeout wrapper fails there every time. I hit it in
eight separate sessions before tracking it to this line.
Build the prefix as positional parameters instead. `"$@"` expands to zero
words when nothing is set, in both bash and zsh, so the uncapped fallback
still works with no special-casing.
Also probe by *running* each candidate rather than trusting `command -v`:
a hit is not proof the binary executes (a stale shell hash cache, or a
symlink left dangling by a relinked coreutils, both produce exec 127).
Verified: bash, zsh and sh all pick gtimeout and run the wrapped command;
with no timeout binary on PATH all three warn once and run uncapped.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
wooter
force-pushed
the
fix/zsh-timeout-wrapper
branch
from
August 10, 2026 11:17
39c8659 to
ba36e25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
agents/codex-implementer.mdtells the lane to invoke codex as:${T:+$T 600}depends on bash word-splitting an unquoted parameter expansion. zsh doesn't do that by default, so"$T 600"arrives atexecveas one argv word and the run dies immediately:Claude Code's Bash tool runs zsh on macOS, which is where this lane predominantly runs — so on those machines the timeout wrapper fails every single invocation. I logged this from eight separate sessions (across Sonnet and Fable lanes) before tracing it to this one line; each time the lane worked around it ad hoc, which is exactly the kind of drift the flag-discipline section exists to prevent.
The fix
Build the prefix as positional parameters:
"$@"expands to zero words when no positional parameters are set — in bash and zsh — so the uncapped fallback needs no special-casing and the wrapped path gets two clean argv words.Secondary hardening: probe by running each candidate instead of trusting
command -v. Acommand -vhit isn't proof the binary executes — a stale shell hash cache or a symlink left dangling by a relinked coreutils both yield exec failures, and I saw both reported against this preflight.Verification
gtimeout, runs the wrapped commandgtimeout, runs the wrapped commandgtimeout, runs the wrapped commandPATHDocs-only change, scoped to the one code block and its row in the flag-discipline table. No behavioural change on bash.