Repository navigation
fix(review): make maintainer reviews opt-in - #1948
Conversation
Skip automatic maintainer-authored and maintainer-labeled item reviews at intake, planning, claim, recovery, and publication. Keep verified explicit requests one-shot and preserve existing automation opt-in labels. Post one bounded, deduplicated reminder asking for review only when needed after work and validation are complete. Validation: builds, lint, docs, formatting, and coverage gates passed on Node 24 in Crabbox. Full check ran 5,822 tests; eight initial failures were diagnosed as stale policy/read-count expectations, absent fixture Git metadata, and a whole-second timestamp flake. All affected checks passed in a 26-test targeted rerun (50.9s). The complete command test file also passed in original order (8.7s). Canonical dispatcher shell tests and 120 author/label/event cases using the GitHub expression evaluator passed. Fresh P0-P2 review is clean. Proof uses the actual signed webhook handler, compiled admission workflow, apply publication entry point, queue alarm recovery, and dispatcher shell with controlled GitHub adapters; no live GitHub writes or model reviews. New reminder shell case: 0.51s; recovery case: 0.042s; expanded admission file: 26.8s. OpenClaw Bay is unaffected: activity ingestion and observer schemas remain unchanged.
|
🦞👀 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. |
|
CI passed on Measured GitHub job wall times: test shards 1–4 took 344, 222, 125, and 137 seconds; static gates 15 seconds; coverage 23 seconds; sparse-build smoke 13 seconds; Windows launcher 79 seconds. These are whole-job timings, not the incremental cost of the new cases. The main PR body records the focused local case timings and behavior-proof limits. |
|
Codex review: needs maintainer review before merge. What this changesThis PR makes maintainer reviews opt-in across intake, planning, recovery, and publication, with a deduplicated reminder. Example: A MEMBER opens PR 321 without an automation opt-in label.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored PR open: current main lacks the policy, the updated publication proof resolves the earlier concern, and no actionable defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGitHub events and explicit commands enter the dispatcher and Worker, pass through queue admission and recovery, and produce review comments and labels through the apply workflow. flowchart TD
A[GitHub events and commands] --> B[Dispatcher and Worker]
B --> C[Maintainer opt-in policy]
C --> D[Queue admission and recovery]
D --> E[Review execution]
E --> F[Publication freshness checks]
F --> G[GitHub comments and labels]
Technical reviewBest possible solution: Use the shared opt-in policy while preserving verified one-shot requests, existing automation opt-ins, and publication freshness checks. Do we have a high-confidence way to reproduce the issue? Current-main planning permits maintainer items, and its intake and publication owners lack the new opt-in checks, establishing the reported behavior from source. Is this the best way to solve the issue? Applying the shared policy through the existing owners closes stale-work paths that dispatcher-only filtering would leave while retaining contributor reviews and explicit requests. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bad5955cef01. 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 HistoryReviewed October 12, 2026, 11:54 PM ET / October 13, 2026, 03:54 UTC (Revision 3). |
|
@clawsweeper review The requested final publication authority proof is complete in the main PR body on the unchanged head. Valid requests and live automation opt-ins publish a durable review; changed source, removed opt-in, and source-drift reuse of an old request produce zero comment, label, or close writes. All CI checks passed. Please review the current body and its proof disposition. |
|
🦞👀 Re-review progress:
|
) ## Problem When a PR is pushed after its first review, ClawSweeper replaces the verdict with a stale notice whose next step reads "Run or wait for a fresh ClawSweeper review on the current PR head." Since #1948, pushes after the first review are not reviewed automatically, so waiting never produces a review. On 2026-10-29, 94 of 341 open non-draft `openclaw/openclaw` PRs showed this notice, and some looked stalled to their authors. ## Fix The stale notice now says: "Comment `@clawsweeper re-review` when the current head is ready; pushes after the first review are not reviewed automatically." Contributors may request reviews of their own items, so the command is available to the readers of this notice. ## User impact Authors of stale PRs know what to do to get a fresh review. Review admission does not change. ## Proof - `node --test test/review-history.test.ts test/apply-label-sync.test.ts` - `pnpm run check:changelog` Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
ClawSweeper automatically reviews maintainer issues and PRs while work is still in progress. Automatic retries and old queue reservations can continue that work even when the entry-point dispatcher skips it.
User Impact
Reviews of maintainer-authored or
maintainer-labelled items are opt-in. Maintainers can request@clawsweeper reviewonce the work and validation are complete, only if a review is needed. Existing autofix/automerge labels remain explicit opt-ins.New issues and ready, non-draft PRs receive at most one friendly reminder: finish the work first, avoid repeated requests while a review is queued or running, and do not let agents request reviews automatically. Edits and pushes do not repeat the reminder. A verified review request authorizes one review; later source changes require a new request.
Why This Change Was Made
One shared maintainer policy now governs planning, webhooks, claim admission, reservation recovery, and hosted-result publication. This prevents bypassing the dispatcher through scheduled work, stale jobs, or publication of an old automatic review. Maintainers are identified by OWNER/MEMBER/COLLABORATOR association or a normalized
maintainerlabel.The reminder reuses the existing acknowledgement dedupe and settlement owner. Trusted-bot receipts prevent duplicate comments and the marker is excluded from command routing. Comment-history reads retain their ten-page limit; if absence cannot be established, the reminder is skipped. Generic GitHub activity ingestion stays enabled.
The target-repository rollout is openclaw/openclaw#170587.
OpenClaw Bay Impact
Bay queue and review projections retain their existing schemas, statuses, and activity ingestion contract. The affected admission and recovery paths are exercised through the Worker and queue entry points; no Bay code or data migration is needed.
Documentation Impact
Updated active guidance in README, AGENTS, scheduler documentation, and the canonical target-dispatcher example. The existing runtime/dispatcher owners and sources of truth remain in place; maintainer classification, explicit opt-in, one-shot authority, and reminder delivery are the update triggers. Added the required changelog fragment.
Evidence
pnpm run check: 5,822 tests, 5,791 passed, 23 skipped, 8 initial failures; 225.9 seconds total (212.8 seconds in the test runner). Coverage: 91.30% lines, 81.42% branches, 93.82% functions.git diff --checkpassed.Real Behavior Proof
Claim: automatic maintainer work is skipped at every admission/publication boundary, explicit requests remain available once, and the reminder does not create duplicate reviews or comments.
Surface and scenarios: signed Worker webhook requests, compiled claim/apply workflow entry points, the actual queue recovery alarm, and the extracted dispatcher shell step. Controlled GitHub adapters cover maintainer issues and PRs, draft/ready transitions, contributor-authored work with a maintainer sender, duplicate/concurrent delivery, pushes/edits, explicit commands and labels, stale source requeues, private-member permission fallback, old reservations/results, trusted/spoofed receipts, and exhausted pagination.
Commands/environment:
pnpm run build:all,pnpm run check, and focusednode --testruns of the affected admission, webhook, queue, apply, planning, and dispatcher suites on the pinned Linux environment above. Both workflow eligibility expressions were also executed with@actions/expressions0.3.61.Observed trace: automatic maintainer claims stop before review; old reservations are removed before acknowledgement lookup/enqueue; old automatic results produce no comment/label/close mutation; verified commands and explicit automation labels remain eligible; duplicate reminders collapse to one trusted receipt; activity ingestion continues. The final dispatcher suite passed 11/11 in 2.93 seconds; the final targeted regression run passed 26/26.
Cost and limits: the added shell reminder case took 0.51 seconds and the recovery case 0.042 seconds; the expanded admission file took 26.8 seconds. The targeted run's 50.9 seconds is mostly an existing reservation case. GitHub CI timings will be recorded when available. These are controlled API boundary proofs, not live GitHub comment mutations or a live Actions dispatch. No rendered UI changed.
Final publication authority proof
Addressed the hosted review's missing proof and associated merge-risk item on the unchanged head
cacf8aee298eba26ff634504ad9b53d6a35e9e15. A fresh isolated AWS Crabbox run used Node 24.19.0, pnpm 12.4.1, the frozen dependency lock, and source-hash checks for the policy and apply owner. Its command completed successfully in 9.48 seconds. No production code changed.The probe executes the real
node dist/clawsweeper.js apply-decisionsentry point with--exact-event-publication --event-apply-proof --sync-comments-only --item-numbers 321. It reads a persisted MEMBER-authored PR report and its production-rendered review lease, then uses controlled GitHub responses at the transport boundary. The explicit-request case supplies the same verifiedre_reviewreceipt fields exercised by the earlier admission proof. The production apply owner makes every eligibility, freshness, lease, and publication decision. There is no dry-run flag.review_comment_synced,durableReviewSynced: trueclawsweeper:autofixopt-inreview_comment_synced,durableReviewSynced: trueskipped_changed_since_review,sourceDriftVerified: trueskipped_maintainer_authoredsource_drift_requeueskipped_maintainer_authoredThe successful cases assert both the public result and a written payload containing the durable
clawsweeper-review item=321marker. Comment API counts include lease/status handling; they do not mean two durable reviews. The rejected cases assert zero comment, item-label, and close writes, with source change rejected after ten read commands and the two maintainer-policy refusals after one read command. The candidate handles the final effects; the adapter supplies only external state and records requests.The first probe stopped because its adapter lacked commit-check and label-catalog responses. Those fixture responses were completed before the passing run; no product failure was hidden or retried unchanged. This closes the review's requested allowed/forbidden/revoked publication matrix. It remains controlled transport proof, not a live GitHub mutation or a claim to execute the model-review service end to end.
GitHub CI also passed on this exact head: https://github.com/openclaw/clawsweeper/actions/runs/38342195653. Whole-job times were 344/222/125/137 seconds for test shards 1–4, 15 seconds for static gates, and 23 seconds for coverage. These are whole-job costs; the focused case costs above describe the added coverage.