Repository navigation
fix(review): keep background re-review start status in the durable comment - #2086
Conversation
…mment Since #2039, unchanged items are re-reviewed on every target-branch commit. Each run posted a new temporary "ClawSweeper status: review started" comment, and GitHub notifies every subscriber of a new comment, so busy target repositories sent a notification per commit even when the review did not change (openclaw/Peekaboo#1114). Queue-owned background re-reviews of an already-reviewed item now carry the started lease by editing the durable review comment, preserving the prior review text and restoring it byte-for-byte on owned cleanup. First reviews, explicit requests, commands and uncoordinated callers keep the separate placeholder, legacy placeholders stay recoverable, and sweep failure cleanup also expires in-place leases discovered by owner.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f57e82583
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const body = quiet | ||
| ? withQuietReviewStartStatusLease(commentBody(durable)!, leaseOptions) | ||
| : renderReviewStartStatusComment(leaseOptions); |
There was a problem hiding this comment.
Keep the mutation lease alive through post-publication apply
When a background re-review produces a close proposal and the publisher adopts its still-active in-place lease, publishing the completed review removes the very marker used as the apply mutation lock. markedReviewCommentForApply in src/clawsweeper-apply-decision-workflow.ts does not preserve that marker, and the subsequent close guard in src/clawsweeper-apply-close-execution.ts calls ownedApplyMutationLeaseBlockReason, which now returns “apply mutation lease … is no longer the elected same-revision lease.” Consequently, an otherwise eligible close is skipped after the review was successfully synced; post-publication recovery-label cleanup can also be blocked. Preserve or transfer the mutation lease until the remaining apply operations finish, rather than removing it with the completed-review PATCH.
AGENTS.md reference: AGENTS.md:L54-L55
Useful? React with 👍 / 👎.
| if (quiet) { | ||
| created = upsertReviewComment(options.item.number, body, durable, undefined, { | ||
| suppressAutomationMarkers: true, | ||
| }); |
There was a problem hiding this comment.
Preserve the lease election against uncoordinated contenders
If an uncoordinated caller acquires a fresh POST lease after this worker's initial comment read but before this PATCH, reusing the older durable comment ID retroactively changes the election winner. The uncoordinated caller can already have confirmed its ownership and started reviewing, while this worker subsequently sees both leases and elects its own lower-ID durable comment through freshDedicatedReviewStartLeases. Queue heartbeats do not serialize the uncoordinated caller, so both workers proceed despite the existing competing-POST election guarantee. The in-place acquisition needs coordination that also prevents displacement of an already-confirmed non-queue lease.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR edits the existing durable review comment to show background re-review progress while preserving lease ownership, review history, and cleanup. Example: A queue-owned background review starts on an item whose durable review comment is ID 42.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful on current main, resolves all four earlier findings, and has no new actionable correctness or security finding. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe exact-review workflow passes queue authority into comment reservation; shared lease readers and apply guards then control publication, label changes, close execution, and cleanup. flowchart TD
A[Queued background review] --> B[Check queue authority]
B --> C[Reserve durable comment lease]
C --> D[Run review]
D --> E[Check elected owner]
E --> F[Publish review and apply guarded changes]
F --> G[Remove owned start status]
C --> H[Restore prior review on failure]
Technical reviewBest possible solution: Keep background start status in the existing durable comment while retaining shared ownership guards, lossless cleanup, and the separate-placeholder fallback. Do we have a high-confidence way to reproduce the issue? Current-main reservation source posts a fresh temporary comment for each new background acquisition, matching the reported repeated start notifications; this review did not execute target code. Is this the best way to solve the issue? The patch addresses notification creation in the existing comment owner and preserves coordination through shared readers and mutation guards, avoiding the previously rejected queue-identity replacement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 400517640b24. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 24, 2026, 2:09 AM ET / 06:09 UTC (Revision 2). |
…nders Address ClawSweeper review findings on the in-place background lease: - keep the adopted apply mutation lock through completed-review publication and the following mutation guards; - let separate POST leases outrank in-place leases and fence the loser, so an older durable comment id cannot retroactively win the election; - read the durable comment losslessly before acquisition, cleanup and CLI release so escapes and controls survive the round trip; - fall back to the separate placeholder when the review plus status and lease would exceed the 61,440-byte durable review limit. Adds an integrated loopback proof covering both contender orders, publication through the close guard, lossless cleanup and a legacy-state upgrade.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem
Since #2039, unchanged items are fully re-reviewed on every target-branch commit. Each run posted a new temporary "ClawSweeper status: review started" comment and later deleted it. GitHub notifies every subscriber of a new comment, but not of an edit. Busy target repositories therefore sent one "review started" notification per commit, even when the review outcome didn't change.
User report: openclaw/Peekaboo#1114. A contributor got about 24 notifications on openclaw/Peekaboo#1106, whose timeline had no non-bot events in that window; the completed review and the next start recorded the same
source_revision.Change
@clawsweeper reviewrequests, commands and uncoordinated callers keep the separate placeholder comment. The uncoordinated race election still needs server-assigned comment IDs, and target-branch re-review admission (fix(review): unchanged issues are fully re-reviewed and re-labeled on every target-branch commit #2039) is unchanged.sweep.yml: the failure-cleanup step also expires in-place leases found by owner, so a lost PATCH acknowledgement can't strand one. The queue decision is passed through to classify reservations.docs/scheduler.mdanddocs/pr-review-comments.mddescribe the lifecycle. The changelog fragment ischangelog.d/quiet-background-rereview.md.pr-behavior-proof
pnpm run build:all, thenTMPDIR="$PWD/.artifacts" RESERVATION_PROOF_PROVIDER=local-process RESERVATION_PROOF_LEASE=none RESERVATION_PROOF_IMAGE=macos-node24 node scripts/e2e/review-reservation.mjs .artifacts/quiet-reservation-head --quietlocal-process, imagemacos-node24, leasenone, headd348d5bc6fRepairs for the first ClawSweeper review
All four P2 findings on 7f57e82 are fixed in d348d5b, each with a regression test:
adopted in-place apply lock survives completed review publication and subsequent mutation guardspost-before-patchandpatch-before-postcasesquiet acquisition and owned cleanup preserve literal escapes and controls losslesslyquiet reservation fits exactly at the UTF-8 limit and falls back one byte above itIntegrated lifecycle proof (
scripts/e2e/review-lease-lifecycle.mjs, headd348d5bc6f)Base-failing, head-passing: an isolated build of 7f57e82, run with the same driver (
PROOF_DIST_ROOT=<baseline>/dist --case <name>), fails all four relevant cases:post-before-patch: both contenders reached final durable-comment writes.patch-before-post: the separate contender was held by durable ID 42.adopt-publication-close: publication removed the marker, and the guard reportedapply mutation lease 42 is no longer the elected same-head lease, so no close occurred.lossless-cleanup: the literal\u001band the real escape control were changed.legacy-upgradeshows that a legacy separate placeholder and an existing durable review created by the old code still load, expire and reap without deleting the old durable review. That is the data-model compatibility proof.Validation on d348d5b:
pnpm run checkon Node 24 runs 6,415 tests, of which 6,384 pass, 31 are skipped and none fail. A fresh branch-mode Codex review found no actionable P0–P2 issues.Limit: the proofs use loopback HTTP. GitHub's inherent read-to-write interval between a comment read and a later write is unchanged from main.
Validation