Skip to content

fix(pr-pipeline): re-fire address-feedback runs lost to a lane token 5xx - #11397

Merged
kyle-sexton merged 3 commits into
mainfrom
fix-8446-refire-token-step-5xx
Oct 31, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix-8446-refire-token-step-5xx

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #8446

Summary

An address-feedback run of pr-unblock whose "Request the lane token" step failed with broker-unreachable or a 5xx lane-token-denied stranded its pull request. feedback-dispatch.mjs starts that activity only when the review lanes finish a head, and the failed pr-unblock / address-feedback check run on the head blocks a second dispatch there. The 2026-10-19 broker outage needed hand re-fires (#8181). refire-refused.mjs re-fired only a workflow-modified 403.

Fix

.github/scripts/pr-merge/refire-refused.mjs, under the decision on #8446 as amended on 2026-10-26:

  • Fresh event, not a rerun. The run gets the same empty commit the workflow-modified path pushes. The new head starts the review lanes, and when they finish, feedback-dispatch dispatches address-feedback again.
  • Transient signatures only. The step's failure annotation must read broker-unreachable: the lanes token broker gave no response… or lane-token-denied: the broker answered 5NN with reason … (the two messages request-lane-token/action.yml emits). No 403 reason is named as transient, so a 403 other than workflow-modified is never re-fired. A 4xx and a malformed status are not re-fired either.
  • Only activities the tick does not dispatch. pr-unblock.yml's lane entry gains transientActivities: ["address-feedback"], read from the dispatched run's title (pr-unblock <activity> #N). The pr-unblock-dispatch tick dispatches resolve-conflicts, review-dependency and fix-ci, so their failures are left to it, and no head gets two retry paths.
  • Capped and recorded. Before the push, the App posts <!-- pr-lane-refire transient run <id> tree <tree> head <head> -->. A marker for the same run at another head stops a second re-fire for that run. Two markers from other runs on the same head tree stop it with a warning, so a person looks. An empty commit keeps the tree, so a broker outage cannot chain re-fires on one change. A marker at the current head means the push did not land, so only the push is retried, within the existing one-hour window.
  • The workflow-modified path is unchanged. The commit message and the step's log line name which cause applied.

Verification

  • New tests in refire-refused.test.mjs. Against main's refire-refused.mjs, 3 of them fail: the 5xx and broker-unreachable re-fire, the cap, and the push retry. The other two are guards that pass on main and on this change: the non-transient 403/4xx test and the tick-activity test.
  • With the change: node --test .github/scripts/pr-merge/*.test.mjs passes 762 of 762. scripts/check-affected.sh --tests exits 0, and its suite step leaves the selected suites to CI.
  • Not changed: the step name and comment in .github/workflows/pr-merge.yml ("Re-fire lane runs refused as workflow-modified") now describe less than the step does. I left the workflow file alone so the change touches no workflow.

Related

  • #11283: isolates per-PR re-fire failures in this script. This change builds on it.
  • #11292: the issue lane's work-unblock re-fire, a separate script with no overlap.
  • #9216 and #8524: broader self-heal work, kept separate per the decision.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KeBVgauhM9QMc1vRhujf3L

kyle-sexton and others added 3 commits October 30, 2026 18:42
refire-refused.mjs pushed an empty commit only for a pr-unblock run the
broker refused as workflow-modified. An address-feedback run whose token
step failed with broker-unreachable or a 5xx lane-token-denied stranded
its pull request: feedback-dispatch starts that activity only when the
review lanes finish a head, and the failed check run blocks a second
dispatch on the same head.

Re-fire those runs through the same empty commit (a fresh event, not a
rerun), only for the lane's transientActivities (address-feedback; the
pr-unblock-dispatch tick already retries the others), never for a 403
other than workflow-modified. Each re-fire posts a transient marker and
is capped at one per failed run and two per head tree.

Closes #8446

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KeBVgauhM9QMc1vRhujf3L
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 30, 2026 23:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T23:41:58.625432Z 61de78c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 61de78cfe369eb0b1044ee72c6df840862a43bee: 0 finding(s), 0 as inline comments.

Security review: no findings

critical-findings: 0

I reviewed all three changed files: the changelog entry, .github/scripts/pr-merge/refire-refused.mjs (a trusted path) and its test file. I read the whole of refire-refused.mjs, not only the diff hunks. No manifests changed, so there are no manifest <field> lines.

Trust controls. The change widens none of them.

  • Who is trusted: the run-qualifying checks in pullOfRun are untouched. They require a listed, non-App actor or a first-attempt github-actions[bot] dispatch, head_branch main, a run commit that is an ancestor of main, and a failed check on the PR head that links to the run.
  • Token scope: the App token and its scope are unchanged. The transient path pushes the same empty fast-forward commit as the workflow-modified path.
  • Merge holds and kill switch: no merge hold, kill switch or broker rule is touched. refire-refused is a re-fire throttle, not a hold.
  • Guard that still runs: the touched check in refusal, which refuses to re-fire a head that edits a lane workflow file, runs before the branch on refused.kind. It therefore applies to the transient path too (refire-refused.mjs:299-306).

Spoofing and injection.

  • Forged markers: the new transient markers are read only from comments by the lane bot. The bot filter now sits before both marker kinds (:307), so a person's comment cannot suppress or forge a cap.
  • Label content: the label that goes into the marker, the PR comment and the commit message comes only from the TRANSIENT regex captures. These are broker-unreachable, a three-digit 5xx status, and a reason of lowercase words joined by hyphens. They cannot carry markdown, HTML-comment terminators or newlines.
  • Activity gating: the activity is read from the dispatched run's title, but that title is only used after pullOfRun has checked the actor, branch, ancestry and check link. The tick-dispatched activities (resolve-conflicts, review-dependency, fix-ci) are excluded by the transientActivities allowlist.
  • 403s: a 403 other than workflow-modified never matches TRANSIENT, which requires 5[0-9]{2}.

Amplification. The caps hold on a trace of the logic.

  • Per run: one re-fire.
  • Per head tree: at most two. Run A re-fires, run B sees one other run and re-fires, and run C sees two and stops with a warning.
  • Empty commits: they keep the tree, so the per-tree cap holds across them.
  • Reset: a real change by the author gives a new tree and resets the count. That reset needs the author's own push, so it is not an amplification path.

I considered one weaker path and rated it below a finding. The annotation text is read from any failure annotation on a failed write job. That is the same trust assumption the existing workflow-modified path makes. A step that emitted a fake broker-unreachable annotation could cause at most two empty commits per tree. That grants no token, secret or trusted-actor access, so I did not report it.

Spend (not a finding). Each transient re-fire starts both review lanes on the new head, at most two re-fires per head tree. This draws on prepaid or subscription usage, so it is not a hold.

Hold: none.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 61de78cfe369eb0b1044ee72c6df840862a43bee: 0 finding(s), 0 as inline comments.

No findings. I read the whole diff, the PR context, and the surrounding refire-refused.mjs (pullOfRun, refusedFile, refusal, headTree). I also checked the two failure messages against .github/actions/request-lane-token/action.yml:337 and :398. I ran no tests myself; the 762-of-762 pass and the 3 tests that fail on main are the author's claims and are unverified here.

What I checked:

  • Signatures. TRANSIENT is anchored to the start of the annotation and matches the two emitted messages: broker-unreachable: the lanes token broker gave no response… and lane-token-denied: the broker answered 5NN with reason …. A 403, a 4xx, lane-check-denied and a garbled 5xx do not match. The workflow-modified path still returns first and is unchanged.
  • Activity scope. Only runs whose title names an activity in transientActivities (address-feedback) get a transient re-fire. The tick-dispatched activities do not, so no head gets two retry paths. This matches the amended decision on pr-pipeline: re-fire PR-lane runs lost to a broker 5xx or token 403 #8446.
  • Caps.
    • A marker for the same run at another head stops the re-fire.
    • Two other runs' markers on the same tree stop it with a warning, because the empty commit keeps the tree.
    • A marker at the current head retries only the push, inside RETRY_MS.
    • The bot-author filter is applied to comments before either marker parse, so a person cannot forge a marker.
  • Marker flow. The marker is posted before the push, so a failed comment pushes nothing. blob is null on the transient path, and nothing on that path reads it.
  • Acceptance criteria on pr-pipeline: re-fire PR-lane runs lost to a broker 5xx or token 403 #8446. All four are met.
    • A 5xx and broker-unreachable are re-fired through an empty commit, not a rerun.
    • A non-transient 403 is not re-fired.
    • The cap is per failed run and per head tree, and a marker records each re-fire. The cap is on the tree, not the head SHA, because the empty commit changes the SHA.
    • The tests cover a 5xx re-fire, a skipped 403, a run at the cap, and the push retry.

Cost: each transient re-fire pushes one empty commit, which starts both review lanes on the new head. That spends prepaid or subscription usage, capped at 2 per tree. It is not a hold.

The author notes that the pr-merge.yml step name and comment are now narrower than the step's behaviour. The PR description also says pr-unblock.yml's lane entry gains transientActivities, but the diff adds it to LANES in refire-refused.mjs. Both are minor and not blocking.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 8776640 Oct 31, 2026
79 checks passed
@kyle-sexton
kyle-sexton deleted the fix-8446-refire-token-step-5xx branch October 31, 2026 00:34
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.

pr-pipeline: re-fire PR-lane runs lost to a broker 5xx or token 403

1 participant