Skip to content

fix(router): preserve paused approvals until repair intent is durable - #863

Merged
clawsweeper[bot] merged 1 commit into
mainfrom
agent/approve-router-durability
Jul 26, 2026
Merged

clawsweeper[bot] merged 1 commit into
mainfrom
agent/approve-router-durability

Conversation

@Takhoffman

@Takhoffman Takhoffman commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep the human-review pause label in place while an approved automerge repair job is still only local
  • let an explicit maintainer approval evaluate merge readiness without first mutating that pause label
  • clear the pause only after the PR merges or a previously durable repair job is dispatched
  • extend the automerge E2E proof through the interrupted approval handoff and replay

Root cause

A maintainer approval removed the pause label before attempting merge. When GitHub rejected the merge because the branch was behind, the router wrote an adopted repair job and waited for the shared state writer before dispatch. If that state publication timed out, the job was lost but the label removal remained. A replay then rejected the same approval because no active pause label remained.

Live instance: openclaw/openclaw#113663

The first exact approval run planned the repair and then failed in Commit comment router ledger: https://github.com/openclaw/clawsweeper/actions/runs/30166399701

A later replay found no actionable approval because the pause label had already been removed: https://github.com/openclaw/clawsweeper/actions/runs/30166403919

Validation

Linux production behavior proof

The exact-head production automerge workflow passed on an Ubuntu 24.04 runner:
https://github.com/openclaw/clawsweeper/actions/runs/30187967236/job/89755940224

Its real containerized router/workflow run reported the approve-intent-persistence scenario as passed for both fixtures:

  • tiny/approve-intent-persistence
  • openclaw-shaped/approve-intent-persistence

The scenario proves the interrupted handoff and replay ordering:

  1. the first maintainer approval writes the repair job and returns waiting while preserving the human-review pause label and issuing no repair dispatch;
  2. after that job becomes durable, replay dispatches the repair;
  3. only the successful durable replay clears the pause label.

The workflow also uploaded artifact automerge-e2e-30187967236-1 (artifact ID 8627648385) containing the run evidence.

@Takhoffman
Takhoffman marked this pull request as ready for review July 26, 2026 04:36

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@clawsweeper

clawsweeper Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞✅
Maintainer-approved ClawSweeper automerge is complete.

Approver: Takhoffman
Head: f2a4cbb2f2c8
Merge status: merged by ClawSweeper automerge
Merged at: 2026-07-26T05:01:35Z
Merge commit: 511dc8c4599c

What merged:

  • Merged fix(router): preserve paused approvals until repair intent is durable after ClawSweeper review.

Automerge notes:

  • No ClawSweeper repair was needed after automerge opt-in.

The automerge loop is complete.

Automerge progress:

  • 2026-07-26 04:36:53 UTC active review reused f2a4cbb2f2c8 (waiting)
  • 2026-07-26 04:52:04 UTC review queued f2a4cbb2f2c8 (queued)
  • 2026-07-26 05:01:37 UTC merged f2a4cbb2f2c8 (merged by ClawSweeper automerge)

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge label Jul 26, 2026
@clawsweeper

clawsweeper Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 26, 2026, 12:54 AM ET / 04:54 UTC.

ClawSweeper review

What this changes

The PR keeps the human-review pause label until an automerge repair job is durably recorded and successfully dispatched, and extends end-to-end replay coverage for that interrupted handoff.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This is a focused, proof-backed fix for a real automerge-router durability failure. The supplied exact-head checks and containerized replay scenario support merging it through the already armed automerge path; no discrete patch defect is evident from the reviewed diff.

Priority: P1
Reviewed head: f2a4cbb2f2c875050308593affe735ef623ffaa2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, credible router fix with direct production-style replay proof and clean exact-head checks.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR links exact-head Ubuntu production workflow output and an uploaded artifact showing after-fix containerized execution of both replay fixtures; the evidence directly covers the changed ordering. Any shared logs should remain redacted of private endpoints and credentials.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR links exact-head Ubuntu production workflow output and an uploaded artifact showing after-fix containerized execution of both replay fixtures; the evidence directly covers the changed ordering. Any shared logs should remain redacted of private endpoints and credentials.
Evidence reviewed 3 items Router ordering change: The patch defers removal of pause-label actions for maintainer_approve_automerge, preserving the actionable pause while executeAutomerge determines whether the approval must hand off to repair.
Replay durability coverage: The E2E scenario now asserts that the first interrupted approval leaves the human-review label intact and issues no dispatch, while the replay dispatches only after the job is durable and then clears the pause.
Exact-head runtime proof: The PR body links a successful Ubuntu production automerge workflow and its uploaded artifact, reporting both tiny and OpenClaw-shaped approve-intent-persistence fixtures passed through the interrupted handoff and replay.
Findings None None.
Security None None.

How this fits together

ClawSweeper's comment router turns maintainer automerge approvals into either a direct merge or a durable repair job for branches that need rebase repair. Pause labels prevent unsafe repeated handling, while the shared state record and repair dispatch let a later replay safely continue the approval.

flowchart LR
  A[Maintainer approval] --> B[Comment router]
  B --> C{Branch mergeable?}
  C -->|Yes| D[Merge pull request]
  C -->|Needs repair| E[Persist repair intent]
  E --> F[Dispatch repair job]
  D --> G[Clear review pause]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - This changes automerge recovery ordering: an untested approval path could leave a human-review pause in place longer than intended or clear it before a repair handoff is durable. The supplied exact-head replay proof materially reduces that risk.
  • Complete next step (P2) - No repair dispatch is needed: the PR is automerge-armed, has no actionable review finding, and includes exact-head real behavior proof.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch surface 2 files changed; 42 added, 31 removed The implementation is limited to comment-router ordering and the corresponding end-to-end durability scenario.
Runtime scenarios 2 production fixtures passed Both tiny and OpenClaw-shaped fixtures exercise the critical interrupted approval and replay sequence.

Merge-risk options

Maintainer options:

  1. Merge with the verified durability ordering (recommended)
    Accept the narrowly scoped automation risk because the exact-head production workflow demonstrates the interrupted approval, durable replay, dispatch, and delayed pause removal sequence.
  2. Pause for an additional router-path audit
    Hold the PR only if a reviewer identifies another approval intent that shares pause-label removal but is not covered by the supplied replay scenario.

Technical review

Best possible solution:

Merge the focused ordering fix after the existing automerge gates confirm the exact head, retaining the durable-state-before-dispatch invariant for all repair-required approvals.

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

Yes: the supplied production incident gives a concrete path—approve a behind PR, interrupt shared-state publication after planning repair, then replay the same approval. The exact-head E2E fixtures exercise that sequence for both minimal and OpenClaw-shaped repositories.

Is this the best way to solve the issue?

Yes: retaining the existing pause until the repair intent is durable prevents replay from losing its actionable marker without adding a new policy or configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against ee5a86127079.

Labels

Label justifications:

  • P1: The reported failure can leave a contributor PR unable to resume an approved automerge repair after a transient state-publication failure.
  • merge-risk: 🚨 automation: The patch changes ordering among GitHub label mutation, durable router state, and repair-workflow dispatch.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 🚀 automerge armed: This PR is in ClawSweeper's automerge lane. Sufficient (linked_artifact): The PR links exact-head Ubuntu production workflow output and an uploaded artifact showing after-fix containerized execution of both replay fixtures; the evidence directly covers the changed ordering. Any shared logs should remain redacted of private endpoints and credentials.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR links exact-head Ubuntu production workflow output and an uploaded artifact showing after-fix containerized execution of both replay fixtures; the evidence directly covers the changed ordering. Any shared logs should remain redacted of private endpoints and credentials.

Evidence

What I checked:

  • Router ordering change: The patch defers removal of pause-label actions for maintainer_approve_automerge, preserving the actionable pause while executeAutomerge determines whether the approval must hand off to repair. (src/repair/comment-router.ts:2232, f2a4cbb2f2c8)
  • Replay durability coverage: The E2E scenario now asserts that the first interrupted approval leaves the human-review label intact and issues no dispatch, while the replay dispatches only after the job is durable and then clears the pause. (test/e2e/automerge/run.mjs:287, f2a4cbb2f2c8)
  • Exact-head runtime proof: The PR body links a successful Ubuntu production automerge workflow and its uploaded artifact, reporting both tiny and OpenClaw-shaped approve-intent-persistence fixtures passed through the interrupted handoff and replay. (test/e2e/automerge/run.mjs:287, f2a4cbb2f2c8)

Likely related people:

  • Takhoffman: Authored the focused router durability change and the matching end-to-end replay coverage; no contradictory current-main ownership signal is present in the supplied review context. (role: recent repair-router contributor; confidence: medium; commits: f2a4cbb2f2c8; files: src/repair/comment-router.ts, test/e2e/automerge/run.mjs)

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 (3 earlier review cycles)
  • reviewed 2026-07-26T04:36:43.632Z sha f2a4cbb :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-26T04:40:39.192Z sha f2a4cbb :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-26T04:45:59.001Z sha f2a4cbb :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jul 26, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor Author

@clawsweeper automerge

@Takhoffman Takhoffman added the clawsweeper:human-review ClawSweeper automerge is paused for maintainer review label Jul 26, 2026
@Takhoffman

Copy link
Copy Markdown
Contributor Author

@clawsweeper approve

@clawsweeper clawsweeper Bot removed the clawsweeper:human-review ClawSweeper automerge is paused for maintainer review label Jul 26, 2026
@clawsweeper
clawsweeper Bot merged commit 511dc8c into main Jul 26, 2026
21 checks passed
@clawsweeper
clawsweeper Bot deleted the agent/approve-router-durability branch July 26, 2026 05:01
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…openclaw#863)

Summary:
- Merged fix(router): preserve paused approvals until repair intent is durable after ClawSweeper review.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head f2a4cbb.
- Required merge gates passed before the squash merge.

Prepared head SHA: f2a4cbb
Review: openclaw#863 (comment)

Co-authored-by: Tak Hoffman <[email protected]>
Approved-by: takhoffman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:automerge Maintainer opted this ClawSweeper PR into bounded ClawSweeper-reviewed automerge merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P1 Urgent regression or broken agent/channel workflow affecting real users now. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 🚀 automerge armed This PR is in ClawSweeper's automerge lane.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant