Repository navigation
fix(pr): auto-merge refuses PRs whose only failing checks are superseded cancelled runs - #171192
Merged
Merged
Conversation
…merge GitHub's statusCheckRollup and mergeStateStatus keep cancelled runs that a newer run of the same workflow/event/job name superseded on the same head (pull_request_target lanes such as ClawSweeper Dispatch draft `opened` runs after `ready_for_review`, and Labeler). After openclaw/ci-gate passes, those PRs are MERGEABLE/UNSTABLE and --auto-merge admission refused them. --auto-merge now selects the immediate squash route for MERGEABLE/UNSTABLE only after one fresh scripts/watch-pr-ci.mjs --completion rollup --once pass at the exact prepared head exits GREEN. The watcher's classifyRollup stays the single supersession owner and the pass also requires the attached ci.yml run to succeed; any unsuperseded failure, hidden or paginated context, missing run identity, pending check, moved head, or watcher error keeps refusing. The watcher gains an opt-in --once flag: one attach and one watch observation without waiting, with --timeout bounding only that pass's evidence reads. This is a one-shot admission predicate, not a pinned snapshot fact: required checks stay server-enforced at dispatch, the exact-head mutation pins the head, and the final stability reread pins the UNSTABLE projection. Pinning rollup contexts would extend the Octopool-allowlisted landing snapshot and the retained-outcome schema. Accepted edge case, documented in merge-admission.md: a new non-required failure on the same head between the pass and dispatch is not rechecked. Measured 2026-10-13: 8 of 80 recently merged final heads (e.g. #170738, #170733, #170675, #170627) had only superseded same-lane cancellations; classifyRollup classifies all four examples GREEN.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
October 13, 2026 17:01
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 14, 2026
…merge (openclaw#171192) GitHub's statusCheckRollup and mergeStateStatus keep cancelled runs that a newer run of the same workflow/event/job name superseded on the same head (pull_request_target lanes such as ClawSweeper Dispatch draft `opened` runs after `ready_for_review`, and Labeler). After openclaw/ci-gate passes, those PRs are MERGEABLE/UNSTABLE and --auto-merge admission refused them. --auto-merge now selects the immediate squash route for MERGEABLE/UNSTABLE only after one fresh scripts/watch-pr-ci.mjs --completion rollup --once pass at the exact prepared head exits GREEN. The watcher's classifyRollup stays the single supersession owner and the pass also requires the attached ci.yml run to succeed; any unsuperseded failure, hidden or paginated context, missing run identity, pending check, moved head, or watcher error keeps refusing. The watcher gains an opt-in --once flag: one attach and one watch observation without waiting, with --timeout bounding only that pass's evidence reads. This is a one-shot admission predicate, not a pinned snapshot fact: required checks stay server-enforced at dispatch, the exact-head mutation pins the head, and the final stability reread pins the UNSTABLE projection. Pinning rollup contexts would extend the Octopool-allowlisted landing snapshot and the retained-outcome schema. Accepted edge case, documented in merge-admission.md: a new non-required failure on the same head between the pass and dispatch is not rechecked. Measured 2026-10-13: 8 of 80 recently merged final heads (e.g. openclaw#170738, openclaw#170733, openclaw#170675, openclaw#170627) had only superseded same-lane cancellations; classifyRollup classifies all four examples GREEN.
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.
What Problem This Solves
Fixes:
scripts/pr merge-run <pr> --auto-mergerefuses to land a PR afteropenclaw/ci-gatepasses when the only non-passing checks are cancelled runs that a newer run of the same check already replaced on that head.User Impact
Maintainers using the default
--auto-mergehandoff no longer get stuck onMERGEABLE/UNSTABLEPRs whose only red entries are superseded same-lane cancellations, such as a draftopenedClawSweeper Dispatch run afterready_for_review, or Labeler. On 2026-10-13, 8 of 80 recently merged final heads were in this state (for example #170738, #170733, #170675, #170627). Any otherUNSTABLEhead still refuses, as before.Why This Change Was Made
GitHub's status rollup and merge state keep counting cancelled runs that a newer run of the same workflow, event and job replaced on the same head. The CI watcher (
classifyRollupinscripts/watch-pr-ci.mts) already keeps only the newest run per check and treats this case as green, so admission reuses it instead of adding a second classifier.For
MERGEABLE/UNSTABLE,--auto-mergenow picks the immediate squash route only after one freshscripts/watch-pr-ci.mjs --completion rollup --oncepass at the exact prepared head reports GREEN. That pass also requires the head'sci.ymlrun to have succeeded. An unsuperseded failure, hidden or paginated checks, missing run identity, a pending check, a moved head, or a watcher error all keep refusing. The watcher gains an opt-in--onceflag: one observation without waiting, where--timeoutonly bounds that pass's reads.This is a one-shot admission check, not part of the pinned admission snapshot. GitHub still enforces required checks when the merge is sent, the merge request is pinned to the exact head, and the final stability re-read still pins the
UNSTABLEstatus. Pinning the rollup would mean extending the Octopool-allowlisted landing snapshot query and the saved merge-outcome format. Accepted edge case: a new non-required failure on the same head in the seconds between the check and the merge is not rechecked. The watcher's existingauto-responseexclusion applies unchanged. Both points are documented indocs/reference/scripts/merge-admission.md.The cross-lane ClawSweeper case (comments and reviews cancelling PR-head runs) is handled separately in #170831.
Evidence
test/scripts/pr-merge-hosted.test.tsrun the realmerge-run --auto-mergeand the real watcher against a stubbedgh. Refused: a lone cancellation, a newer run that also failed, and an unfinishedci.ymlrun, each with no merge sent and no saved outcome. Admitted: a superseded-only head, as one exact-head immediate squash with no auto request.pnpm test test/scripts/pr-merge-hosted.test.ts --maxWorkers=1 -t "native superseded-only UNSTABLE merge handoff": 4 passed, about 50s locally under heavy host load.pr-merge-hosted.test.ts25/25 (135s),pr-merge-admission.test.ts72/72 (417s, load average around 40),watch-pr-ci.test.ts264/264 (237s), including the new--onceparsing and single-pass cases.classifyRollupclassifies the final heads of fix(ci): keep targeted type checks when docs are deleted #170738, fix(ci): preserve remote proof failures without forced local checks #170733, fix: prevent false failure warnings after reply retries #170675 and fix(gateway): show thinking off when Claude defaults to off #170627 as GREEN. Their only non-passing contexts are supersededdispatch/labelpull_request_targetcancellations.tsgo:scripts,tsgo:test:root, ShellCheck, a Bash 3.2 syntax check, andgit diff --checkall pass. Codex autoreview found no issues on the final diff.