From be410521aed2bec211b100d86fc567c9192e13a8 Mon Sep 17 00:00:00 2001 From: T3 Code PR Stack <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:10:14 +0200 Subject: [PATCH] fix(agent): run the pre-push gate without pnpm exec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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) --- .githooks/pre-push | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.githooks/pre-push b/.githooks/pre-push index 212a5eba9987..73b9011cd900 100755 --- a/.githooks/pre-push +++ b/.githooks/pre-push @@ -1,6 +1,6 @@ # Agent-only ship gate (humans: no-op). See scripts/agent-pre-push.mjs. # Draft / no PR: free agent push. Ready PR: vp check + typecheck + tests. -# Publish: pnpm pr:ready (not raw gh pr ready). Agent gh shim: .tools/bin/gh. +# Publish: pnpm pr:ready, or raw `gh pr ready` — the shim runs the same gate first. # # Humans: SKIP_AGENT_PREPUSH=1 git push # Agents: never SKIP_AGENT_PREPUSH / never --no-verify @@ -9,4 +9,8 @@ for name in $(git rev-parse --local-env-vars); do unset "$name" done -pnpm exec node scripts/agent-pre-push.mjs +# Plain `node`, not `pnpm exec node`: pnpm runs a dependency-status check first +# and will try to purge node_modules when the lockfile moved (a rebase does it), +# which aborts without a TTY — the hook then fails with a pnpm error instead of +# anything about the gate. The gate puts node_modules/.bin on PATH itself. +node scripts/agent-pre-push.mjs