Skip to content

fix(forge-core): drop -o pipefail from the push script — dash aborts on it (closes #62) - #63

Merged
ALLiDoizCode merged 1 commit into
mainfrom
fix/62-dash-pipefail
Aug 10, 2026
Merged

fix(forge-core): drop -o pipefail from the push script — dash aborts on it (closes #62)#63
ALLiDoizCode merged 1 commit into
mainfrom
fix/62-dash-pipefail

Conversation

@ALLiDoizCode

Copy link
Copy Markdown
Contributor

Closes #62. Regression from #61, which I merged — owning the fix.

pushBranch's mint script opened with set -euo pipefail, but sandbox.exec runs through sh -c and the sandbox's /bin/sh is dash. dash has no -o pipefail: it aborts on line 1 with exit 2, so git push never ran. Every CI run has APP_ID/APP_PRIVATE_KEY set, so no agent PR could be opened — the factory has been down since #61 landed at 19:15Z.

Reproduced under the exact shell, both directions

OLD  $ dash -c 'set -euo pipefail; echo reached'
     dash: 1: set: Illegal option -o pipefail          exit 2     ← byte-identical to #62's evidence

NEW  $ dash -c 'set -eu; TOKEN_FILE=$(mktemp); ... '
     LINE 7 REACHED — push would run; mode=600 bytes=11  exit 0

-o pipefail was never load-bearing: the script contains no pipeline. set -eu keeps the fail-fast behaviour, and the dash run above confirms the mode-600 token file and the token round-trip still work. The empty credential.helper= reset — the load-bearing part of #61 — is untouched.

Scope

Fixed both copies reached via sandbox.exec: packages/forge-core/src/sandcastle-runners.ts and .sandcastle/agent-implement-issue.ts.

Not changed: packages/forge-cli/src/stamp.ts's generated verify stub — it carries #!/usr/bin/env bash and is invoked as bash verify/<id>.sh, so pipefail is correct there.

Not propagating: connector's runner has no wrapper script; no other factory repo carries this shape. Checked before assuming.

Test note

pnpm test shows 5 failed files / 6 failed tests — identical on main (runPrGateLadder is not a function, in doctor.test.ts), so pre-existing and unrelated. Flagging separately that Forge's gate passes while those fail, which means the gate is not running the full suite.

How this got in

I reviewed #61's diff and checked the credential handling, which was correct — but I did not check the shell the script runs under. The gate cannot catch it: the push path only executes in-sandbox at runtime.

…s on it

Closes #62

`pushBranch`'s fresh-mint script opened with `set -euo pipefail`, but
`sandbox.exec` runs every command through `sh -c`, and `/bin/sh` in the
sandbox image is dash. dash has no `-o pipefail`, so it aborted on line 1
with exit 2 and `git push` never ran. With APP_ID/APP_PRIVATE_KEY present —
i.e. every CI run — no agent PR could be opened at all. Forge's factory has
been fully down since #61 merged.

Reproduced and fixed under the exact shell:

  OLD  $ dash -c 'set -euo pipefail; echo reached'
       dash: 1: set: Illegal option -o pipefail        exit 2

  NEW  $ dash -c 'set -eu; ...'
       LINE 7 REACHED — push would run; mode=600 bytes=11   exit 0

`-o pipefail` was never load-bearing here: the script contains no pipeline.
`set -eu` keeps the fail-fast behaviour that matters, and the mode-600 token
file, the EXIT trap and the empty `credential.helper=` reset are all
untouched — verified still present in the dash run above.

Fixed in both copies that go through `sandbox.exec`:
  - packages/forge-core/src/sandcastle-runners.ts
  - .sandcastle/agent-implement-issue.ts

Deliberately NOT changed: packages/forge-cli/src/stamp.ts's generated
verify stub, which carries a `#!/usr/bin/env bash` shebang and is invoked as
`bash verify/<id>.sh` — pipefail is valid and wanted there.

Not propagating: connector's runner has no wrapper script, so no other
factory repo carries this shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ALLiDoizCode
ALLiDoizCode merged commit 64681cd into main Aug 10, 2026
2 checks passed
@ALLiDoizCode
ALLiDoizCode deleted the fix/62-dash-pipefail branch August 10, 2026 21:40
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.

forge-core: every agent push fails — pushBranch's mint script uses set -o pipefail under dash

1 participant