Repository navigation
fix: preserve PR merge poll authentication after relaunch - #34
Merged
Merged
Conversation
Accept the exact control_relaunch_tx metadata key after preserved PR fields. This also handles existing broken-order records while unknown trailing keys remain rejected.
This was referenced Nov 19, 2026
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.
Intent
Especially take care of the firstmate issue we have.
The firstmate issue: after
bin/fm-control.sh <id> relaunchon a task that already has a PR, the watcher rejects that task's armed PR merge poll ("check: rejected unauthenticated state checks: state/.check.sh"), so a green or merged PR is never noticed. Seen 2026-10-08/09 and five times on 2026-10-23 (pv-voice-checked-readback-b1, pv-online-preview-rough-edges-e1, pv-tier2-second-runner-r1, pv-no-receipt-fee-label-f1, pv-place-by-quote-p1 earlier).Root cause found 2026-10-23:
bin/fm-spawn.sh --relaunchwritescontrol_relaunch_tx=after the preservedpr=/pr_head=lines (around fm-spawn.sh line 5937), andfm_pr_metadata_identity_parse(bin/fm-pr-lib.sh around line 427) treats any unknown key afterpr=as invalid, sofm_pr_poll_artifacts_content_validfails. Re-running fm-pr-check.sh does not fix it while that line sits afterpr=. Current manual workaround: move thecontrol_relaunch_tx=line abovepr=in state/.meta.What Changed
control_relaunch_txmetadata after PR identity fields so armed PR merge polls remain authenticated after relaunch.Risk Assessment
The parser exception was chosen instead of reordering the relaunch writer because accepting this exact known key also fixes metadata already written in the broken order. Existing records with
control_relaunch_tx=afterpr=/pr_head=require no manual metadata edit. Unknown trailing keys, including similarly named keys, remain rejected.Firstmate approved the full-relaunch test limitation based on the before/after parser reproduction, the regression checks, and compatibility with existing records. A live PR-task relaunch will be confirmed after merge.
✅ Low: This is a one-arm parser change. The shared metadata parser now accepts the exact
control_relaunch_tx=key afterpr=, which is the linefm-spawn.sh --relaunchappends (fm-spawn.sh:5951). Every poll-authentication caller goes through this parser, so the fix lands at the earliest shared boundary. The marker is never treated as PR identity, the poll registration does not hash the meta file, and duplicatepr=lines and other unknown trailing keys, including near-miss names, are still refused.Testing
The base parser reproduced the reported rejection; the target watcher detected a real merged PR in both marker positions and preserved malformed-metadata guards. The focused regression passed only with the fix. CLI transcripts were captured and fixtures cleaned up. Full worker relaunch was blocked by Codex folder trust.
Evidence: Live watcher reproduction and guard checks
Source: Live watcher reproduction and guard checks
Evidence: Full relaunch attempt blocked at Codex folder trust
Source: Full relaunch attempt blocked at Codex folder trust
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
python3 .nm-test-pr/live.py: ran real PR registration and watcher commands against merged GitHub PR #33 in isolated lab homesRepeated the watcher reproduction with the base parser: reproduced the exact unauthenticated-check rejectionTMPDIR="$PWD/.nm-test-pr" bash tests/.nm-pr-focused.sh: selectedtest_relaunch_metadata_keeps_poll_authenticated; passedTMPDIR="$PWD/.nm-test-pr" bash tests/.nm-pr-baseline.sh: the same regression failed against the base parser as expectedpython3 .nm-test-pr/relaunch.py: attempted real Codex lifecycle verification using a real Treehouse lease and a private 120×40 tmux sessionStopped private tmux servers, removed transient fixtures and runners, and confirmed a clean worktree✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.