Skip to content

improve: hand pending PR checks to GitHub auto-merge - #154307

Merged
steipete merged 2 commits into
mainfrom
codex/github-auto-merge-handoff
Sep 21, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/github-auto-merge-handoff

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #154304

What Problem This Solves

Agents wait for CI and repeatedly read GitHub before requesting auto-merge, so the native workflow gets little benefit from GitHub owning the wait.

User Impact

After completed review, agents can submit one prepared-head auto-merge request and stop polling while GitHub waits for required checks and reviews. Already failing required checks still block submission; no admin bypass is added.

Why This Change Was Made

The agent default now uses OPENCLAW_PR_GATES_REMOTE=github scripts/pr prepare-run <PR> followed by scripts/pr merge-run <PR> --auto-merge. Pending preparation never claims successful proof. The existing merge owner admits GitHub's pending-check BLOCKED state, preserves contributor attribution and uncertain-request recovery, and returns an accepted pending outcome without a watcher.

This mode relies on the enforced PR openclaw/ci-gate (CI plus applicable security review), replacing separate scheduled Testbox proof. Completed-evidence modes remain available. Head matching applies at submission; GitHub can retain auto-merge after a later collaborator push, so a changed head is new review work.

Evidence

  • 136 selected tests passed on Linux/Node 26.8.2: preparation, hosted and pending handoff, attribution, admission, and accepted/uncertain request recovery.
  • New pending-handoff regression fails against the original merge owner at Required checks are still pending; preparation regressions also fail against original owners.
  • Full changed-file checks passed, including test types, scripts/test lint, format, dependency guards, and dead exports. Independent P0–P2 review: scoped-clean.
  • The real wrapper fixture submits exactly one --auto --match-head-commit request, reads required checks once, performs no hosted verification/CI watcher, retains pending state, and does not comment or clean up early.
  • Live repository settings verified: auto-merge enabled, required openclaw/ci-gate bound to GitHub Actions, stale approvals dismissed on push. No repository setting or enforced rule changed.

Local test cost (single worker, repository test wrapper): pr-prepare-gates.test.ts 11.49 s wall (80 tests); pr-merge-hosted.test.ts 59.42 s wall (24 tests); selected pr-merge-outcome.test.ts 62.43 s wall (32 tests, 341 skipped). The two longer fixtures exercise real Git, Bash, the process lock, and retained dispatch/recovery state; a mocked helper would not prove that handoff. Fixtures reuse suite setup. CI run 35554464414: preparation test bodies totaled 5.320 s (80 cases); hosted handoff bodies 22.272 s (24 cases), including 4.053 s for the seven new pending-handoff rows; the full 373-case merge-outcome file took 442.50 s wall. The failed release-check case took 120.089 s. Per-file wall times for preparation, hosted handoff, and release-check were not emitted by the verbose CI reporter.

Release-check fixture repair

The sparse release-check fixture now applies the existing test runtime policy to its Node CLI children. Those children previously omitted --no-concurrent-sparkplug, leaving their explicit error exits exposed to the documented Node 24 compiler shutdown deadlock. The existing sparse-import probe now verifies the child's actual runtime arguments; no extra process, timeout increase, retry, or weaker package assertion was added.

The new probe failed on the original child-launch code and passes with the repair. On exact CI Node 24.19.0, all 20 standalone full-file runs passed (14 tests each; 22.212–37.992 seconds wall, mean 25.971 seconds). All three full original-order shard runs passed: 31 files and 934 tests each (two intentional skips), in 404.80, 412.37, and 441.79 seconds. The formerly timing-out case took 19.717, 19.259, and 19.112 seconds. The observed file order matched the original CI order in all three runs. Missing local dependency links and archive tools were repaired before counting the clean runs; no source changes or timeout increases accommodated the environment.

CI run 35554464414 timed out this case at 120 seconds. That intermittent timeout did not reproduce in the original-order baseline or ten standalone baseline repeats, so its precise cause remains unconfirmed; the reproduced defect is the missing child runtime policy. Exact-head CI run 35556981010 and Security Review passed. GitHub auto-merged this head as cdd01a1 at 2026-09-21 03:34 UTC; the remaining local shard repeats completed afterward. The cached failing log contains only the aggregate test timeout, without child command checkpoints or exit/close stacks, so it cannot distinguish import, execution, or shutdown.

Follow-up: the same release-check120-second timeout recurred in CI run35559425575 on the subsequent API-fallback PR#154376. The Node runtime-policy omission was real, but its repair is insufficient to resolve the intermittent timeout. Child-process investigation continues there; the earlier passing repetitions do not establish causality.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 21, 2026 02:31
@steipete steipete self-assigned this Sep 21, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete enabled auto-merge (squash) September 21, 2026 02:35
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 20, 2026, 11:26 PM ET / September 21, 2026, 03:26 UTC (Revision 2).

ClawSweeper review

What this changes

The PR lets the native landing workflow submit GitHub auto-merge while required checks are pending, updates agent instructions and regression coverage, and applies the existing Node shutdown policy to release-check test children.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: the maintainer-requested handoff remains absent from main and the latest release. No introduced correctness defect was found, but the documented release-check timeout investigation remains incomplete.

Priority: P2
Reviewed head: c5bfe439835ff3fff5e0de5d276a5073e8c7c653

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful boundary regressions and no concrete patch defect; the earlier timeout still needs validation closeout.
Proof confidence 🌊 off-meta tidepool Not applicable: The external-contributor proof gate does not apply to this member-authored PR. Wrapper fixtures cover pending admission with a synthetic GitHub client, and live rules confirm server enforcement; neither is claimed as a live run of the changed wrapper.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this member-authored PR. Wrapper fixtures cover pending admission with a synthetic GitHub client, and live rules confirm server enforcement; neither is claimed as a live run of the changed wrapper.
Evidence reviewed 10 items Pinned introduction and review continuity: Reviewed the merge-base-to-head changes, excluding base-only drift. Since the previous reviewed head, only the release-check fixture changed; the prior review recorded no findings. The supplied test merge is stale and was not used to infer removals from main.
Current main still rejects pending checks: The fetched main implementation unconditionally stops when required checks are pending, so the central requested behavior remains necessary.
Latest release retains the same restriction: The v2026.9.5 source also rejects pending required checks before merge submission.
Findings None None.
Security None None.

How this fits together

The native PR tooling consumes review records, prepared commits, and GitHub checks to submit merge requests. GitHub then enforces repository rules, while the tooling retains request state for reconciliation and cleanup.

flowchart TD
  A[Completed PR review] --> B[Prepare exact head]
  B --> C[Record pending checks]
  C --> D{Required checks failing?}
  D -->|Yes| E[Stop submission]
  D -->|No| F[Submit pinned merge request]
  F --> G[GitHub enforces merge rules]
  G --> H[Retain outcome for reconciliation]
Loading

Before merge

  • Resolve merge risk (P2) - The earlier release-check timeout remains unexplained; standalone passes and the runtime-flag regression do not yet exclude an original-shard interaction.
  • Complete next step (P2) - Complete the documented release-check failure investigation and original-shard validation before landing; fresh green CI alone does not explain the earlier timeout.
Agent review details

Security

None.

PR surface

Tests +193, Docs +20, Other +44. Total +257 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 5 224 31 +193
Docs 3 29 9 +20
Config 0 0 0 0
Generated 0 0 0 0
Other 4 79 35 +44
Total 12 332 75 +257

Review metrics

Metric Value Why it matters
Preparation configuration 1 new value for an existing environment variable The github mode is explicit; existing completed-evidence modes remain available.
Production versus regression growth Production/tooling +44 net lines; tests/support +193 Production growth extends existing owners, while most added code checks admission and retained-request behavior.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #154304
Summary: This PR is the explicit implementation candidate for the open workflow request.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one native merge owner for pending and completed-check modes, with GitHub enforcing required gates and retained records distinguishing acceptance from completion.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one native merge owner for pending and completed-check modes, with GitHub enforcing required gates and retained records distinguishing acceptance from completion.

Do we have a high-confidence way to reproduce the issue?

Not applicable to the primary workflow enhancement: main and the latest release explicitly reject pending checks. The separate release-check timeout was not reproduced in this read-only review.

Is this the best way to solve the issue?

Yes: extending the existing preparation and merge owners avoids a competing scheduler, preserves completed-evidence modes, and delegates waiting to GitHub's enforced rules.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d6b6253b965d.

Labels

Label justifications:

  • P2: This is a bounded maintainer-workflow improvement that reduces CI waiting and repeated GitHub reads.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this member-authored PR. Wrapper fixtures cover pending admission with a synthetic GitHub client, and live rules confirm server enforcement; neither is claimed as a live run of the changed wrapper.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the merge-base-to-head changes, excluding base-only drift. Since the previous reviewed head, only the release-check fixture changed; the prior review recorded no findings. The supplied test merge is stale and was not used to infer removals from main. (c5bfe439835f)
  • Current main still rejects pending checks: The fetched main implementation unconditionally stops when required checks are pending, so the central requested behavior remains necessary. (scripts/pr-lib/merge.sh:320, d6b6253b965d)
  • Latest release retains the same restriction: The v2026.9.5 source also rejects pending required checks before merge submission. (scripts/pr-lib/merge.sh:309, ec9c1a13db89)
  • Admission and recovery safeguards: Pending mode requires the prepared head, explicit auto-merge, GraphQL transport, and the required CI-gate context; failed checks remain blocking. Final admission rechecks PR identity and review evidence, and dispatch retains the existing single-request outcome record. (scripts/pr-lib/merge.sh:209, c5bfe439835f)
  • Live server enforcement: GitHub's effective main rules require openclaw/ci-gate from integration 15368, dismiss stale approvals on push, and require applicable code-owner review. The live PR also has an accepted squash auto-merge request; that does not establish execution through the changed wrapper.
  • Explicit workflow tradeoffs: The supplied maintainer-authored body explicitly selects enforced PR checks instead of separate scheduled Testbox evidence and acknowledges that collaborator pushes can retain GitHub auto-merge. The landing instructions preserve completed-evidence alternatives and require changed heads to receive new review. (.agents/skills/openclaw-pr-maintainer/references/landing.md:75, c5bfe439835f)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the release-check timeout diagnosis, three clean runs in the original shard order, and relevant sibling results.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-21T02:43:16.511Z sha be65106 :: needs maintainer review before merge. :: none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Let GitHub wait for CI after agents approve a PR for merging

1 participant