Repository navigation
fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads - #3352
nightskytech wants to merge 1 commit into
Conversation
…yloads pi-code loads the tracked Claude settings but has no asyncRewake support: it awaits every Stop hook, so the auto-arm's foreground monitoring holds Pi's turn open for the declared multi-hour timeout (observed live 2026-08-30). Stand down when the payload's transcript_path carries a .pi/ component, the stamp pi-code puts on every payload and a Claude transcript never has. Fail direction is unchanged: missing payload, jq, or transcript_path runs. Fixes #3343.
Confidence Score: 5/5The PR appears safe to merge with no concrete changed-code defect identified. The guard is narrowly scoped to Pi-shaped transcript paths, fails toward retaining existing behavior when payload data or jq is unavailable, and includes regression coverage for both sides of the discriminator. Reviews (1): Last reviewed commit: "fix(bin): stand down the Claude Stop aut..." | Re-trigger Greptile |
|
Speaking as Kun's firstmate: first look of #3352 vs main HEAD: VISION (per major section; files: VISION.md @ main d71f4b9, bin/fm-claude-stop-autoarm.sh main+PR, bin/fm-hook-host-lib.sh main, tests/fm-claude-stop-autoarm.test.sh PR, issue #3343):
Security (fail-closed): workflow-zero (only CI/NM this HEAD:
Overlap: none that needs a hold. This is the covering PR for #3343. Older auto-arm PRs (#3163, #2584, #2149) do not implement the pi-code stand-down. Will honestly close #3343 once it lands. Waiting on author: rebind this HEAD through |
|
Withdrawing this PR: the scoped Stop-hook fix grew into predicate, session-start-ownership, and documentation work that belongs with the project rather than an outside reporter. All investigation evidence is in #3343 and the review findings above; the freeze itself is reproducible, and the narrow guard in this PR's original commit (5b93507) works and is running as a local hotfix on the reporting installation. Yours to finish in whatever shape fits the vision. |
…yloads (#5657) * fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads pi-code loads the tracked Claude settings but has no asyncRewake, so it awaits every Stop hook; without a stand-down the auto-arm runs synchronously inside Pi's turn end and holds it open for the declared multi-hour timeout. Stand down when the payload's transcript_path contains a /.pi/ path component, the same discriminator the closed-but- unmerged fix in #3352 used, with an explicit string-type check on the jq filter. Fixes #3343 * no-mistakes(document): document pi-code stand-down in harness integrations reference
…yloads (kunchenguid#5657) * fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads pi-code loads the tracked Claude settings but has no asyncRewake, so it awaits every Stop hook; without a stand-down the auto-arm runs synchronously inside Pi's turn end and holds it open for the declared multi-hour timeout. Stand down when the payload's transcript_path contains a /.pi/ path component, the same discriminator the closed-but- unmerged fix in kunchenguid#3352 used, with an explicit string-type check on the jq filter. Fixes kunchenguid#3343 * no-mistakes(document): document pi-code stand-down in harness integrations reference
…yloads (kunchenguid#5657) * fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads pi-code loads the tracked Claude settings but has no asyncRewake, so it awaits every Stop hook; without a stand-down the auto-arm runs synchronously inside Pi's turn end and holds it open for the declared multi-hour timeout. Stand down when the payload's transcript_path contains a /.pi/ path component, the same discriminator the closed-but- unmerged fix in kunchenguid#3352 used, with an explicit string-type check on the jq filter. Fixes kunchenguid#3343 * no-mistakes(document): document pi-code stand-down in harness integrations reference
…yloads (kunchenguid#5657) * fix(bin): stand down the Claude Stop auto-arm on pi-code-delivered payloads pi-code loads the tracked Claude settings but has no asyncRewake, so it awaits every Stop hook; without a stand-down the auto-arm runs synchronously inside Pi's turn end and holds it open for the declared multi-hour timeout. Stand down when the payload's transcript_path contains a /.pi/ path component, the same discriminator the closed-but- unmerged fix in kunchenguid#3352 used, with an explicit string-type check on the jq filter. Fixes kunchenguid#3343 * no-mistakes(document): document pi-code stand-down in harness integrations reference
Fixes #3343.
What
bin/fm-claude-stop-autoarm.shnow stands down when its Stop payload was delivered by pi-code, exactly as it already does for Cursor. The stand-down is scoped to this one hook; every other Claude-shaped hook pi-code delivers keeps running.Why
pi-code loads the tracked
.claude/settings.jsonbut has noasyncRewakesupport: it awaits every Stop hook (await Promise.all(...), verified through pi-code 1.0.14, reported upstream as ilovepixelart/pi-code#123). The auto-arm's foreground monitoring therefore runs synchronously inside Pi's turn end and holds the turn open for the declared 28,800s timeout. Observed live 2026-08-30:piblocked on the hook process tree, all typed input queued; killing the hook released the session immediately. Triage on the issue classed thisrestoreand asked for exactly this scoped payload guard.How
Per the payload-not-environment principle in
bin/fm-hook-host-lib.sh: pi-code stamps every hook payload'stranscript_pathwith Pi's own session file, which always contains a.pi/path component (~/.pi/agent/sessions/...); a Claude transcript path never does. The guard exits 0 whentranscript_pathcontains/.pi/. Fail direction is unchanged: missing payload, missing jq, or missingtranscript_pathmeans the hook runs, because a skipped run under a genuine Claude primary is the worse failure.Tests
Two regressions added to
tests/fm-claude-stop-autoarm.test.sh:test_stands_down_on_pi_code_delivered_payload— a pi-stamped payload exits 0 silently with no arm, no epoch write.test_claude_transcript_path_still_arms— a payload carrying a genuine Claudetranscript_pathstill arms and rewakes (exit 2), so the discriminator can only fail toward running.Verification
bash tests/fm-claude-stop-autoarm.test.sh: 41 ok, 0 failures (39 pre-existing + 2 new), macOS arm64.bin/fm-lint.shwith pinned ShellCheck 0.11.0 and actionlint 1.7.12: clean.🤖 Generated with Claude Code