fix(agent): run the pre-push gate without pnpm exec - #305
Merged
Conversation
`pnpm exec` runs a dependency-status check before the command. When the lockfile
has moved — a rebase does it — pnpm decides node_modules must be purged and
reinstalled, then aborts because a git hook has no TTY:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken gate rather than a stale lockfile.
Hit live while rebasing effect-app; fixed there in effect-app#838 and ported here.
Invoke node directly instead; the gate puts node_modules/.bin on PATH itself, so
pnpm was not providing anything still needed.
Also corrects the header: since #302 the shim gates `gh pr ready` rather than
refusing it, so raw `gh pr ready` is a supported way to publish.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
patroza
marked this pull request as ready for review
August 4, 2026 04:59
patroza
added a commit
that referenced
this pull request
Aug 4, 2026
`pnpm exec` runs a dependency-status check before the command. When the lockfile
has moved — a rebase does it — pnpm decides node_modules must be purged and
reinstalled, then aborts because a git hook has no TTY:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken gate rather than a stale lockfile.
Hit live while rebasing effect-app; fixed there in effect-app#838 and ported here.
Invoke node directly instead; the gate puts node_modules/.bin on PATH itself, so
pnpm was not providing anything still needed.
Also corrects the header: since #302 the shim gates `gh pr ready` rather than
refusing it, so raw `gh pr ready` is a supported way to publish.
Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
patroza
added a commit
that referenced
this pull request
Aug 4, 2026
`pnpm exec` runs a dependency-status check before the command. When the lockfile
has moved — a rebase does it — pnpm decides node_modules must be purged and
reinstalled, then aborts because a git hook has no TTY:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken gate rather than a stale lockfile.
Hit live while rebasing effect-app; fixed there in effect-app#838 and ported here.
Invoke node directly instead; the gate puts node_modules/.bin on PATH itself, so
pnpm was not providing anything still needed.
Also corrects the header: since #302 the shim gates `gh pr ready` rather than
refusing it, so raw `gh pr ready` is a supported way to publish.
Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
patroza
added a commit
that referenced
this pull request
Aug 4, 2026
`pnpm exec` runs a dependency-status check before the command. When the lockfile
has moved — a rebase does it — pnpm decides node_modules must be purged and
reinstalled, then aborts because a git hook has no TTY:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken gate rather than a stale lockfile.
Hit live while rebasing effect-app; fixed there in effect-app#838 and ported here.
Invoke node directly instead; the gate puts node_modules/.bin on PATH itself, so
pnpm was not providing anything still needed.
Also corrects the header: since #302 the shim gates `gh pr ready` rather than
refusing it, so raw `gh pr ready` is a supported way to publish.
Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
patroza
added a commit
that referenced
this pull request
Aug 5, 2026
`pnpm exec` runs a dependency-status check before the command. When the lockfile
has moved — a rebase does it — pnpm decides node_modules must be purged and
reinstalled, then aborts because a git hook has no TTY:
ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken gate rather than a stale lockfile.
Hit live while rebasing effect-app; fixed there in effect-app#838 and ported here.
Invoke node directly instead; the gate puts node_modules/.bin on PATH itself, so
pnpm was not providing anything still needed.
Also corrects the header: since #302 the shim gates `gh pr ready` rather than
refusing it, so raw `gh pr ready` is a supported way to publish.
Co-authored-by: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Why
pnpm execruns a dependency-status check before the command it wraps. When thelockfile has moved — a rebase does exactly that — pnpm decides
node_modulesmust be purged and reinstalled, then aborts because a git hook has no TTY:
The push then fails with a pnpm error that says nothing about the gate, because
the gate never started. It reads as a broken ship gate rather than a stale
lockfile, which is the worst version of this failure: the thing that reports
problems is itself the thing that appears broken.
Hit live while rebasing an effect-app PR onto a moved base.
What
Invoke
nodedirectly from.githooks/pre-pushinstead ofpnpm exec node.How
Nothing is lost by dropping
pnpm exechere: the gate putsnode_modules/.binonPATHitself (withRepoBin), which is whatpnpm execwas providing. The hook needs only a
nodebinary, and the shell that runs a githook already has one.
Fixed first in effect-app#838 and ported unchanged to the other repos that share
this gate.
Remarks
Same class as the other headless failures this gate has surfaced: a tool that
silently changes behaviour based on TTY or CI detection breaks inside a hook, and
does it confusingly. Worth remembering when adding anything else to this path.
Flow doc updated: n/a (agent tooling)
E2E coverage: n/a — shell hook, no product behaviour; exercised by every agent push
Design angles: n/a (one-line fix)