Repository navigation
refactor: simplify sweep runtime and recover publication backlog - #1012
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 12:49 PM ET / 16:49 UTC. ClawSweeper reviewWhat this changesThis PR replaces the large CLI entrypoint with a launcher plus focused runtime modules, safely retries dead-letter reconciliation after an atomic cleanup race, and lowers the bounded publication-batch refill delay from 30 seconds to 5 seconds. Merge readinessThis PR appears technically sound and includes strong after-fix operator proof, but it is a 22-file extraction of central sweep/apply orchestration plus a production queue-timing change. Keep it open for the current-head checks to finish and maintainer merge review rather than treating it as cleanup or an automated repair. Likely related people: Peter Steinberger is the strongest routing candidate (high confidence), with Vincent Koc as an adjacent apply/publication contributor (medium confidence). Priority: P2 Review scores
Verification
How this fits togetherClawSweeper's runtime accepts review and apply commands, coordinates GitHub operations and durable records, then publishes results through Worker-backed queues. The changed dead-letter operator cleans up terminal publication records and can queue safe fresh reviews without exceeding configured recovery or publication limits. flowchart LR
Commands[CLI and workflow commands] --> Runtime[Sweep and apply runtime]
Runtime --> Guards[Lease, proof, and close guards]
Guards --> Records[Durable review records]
Records --> Queue[Publication queue]
Queue --> Reconcile[Dead-letter reconciler]
Reconcile --> Worker[Worker guarded resolution]
Worker --> Status[Published state and dashboard]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused modular runtime and bounded retry behavior only after the final branch's checks confirm the extracted command paths remain intact; retain the existing capacity caps and fail-closed cleanup contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a refactor plus an operational recovery correction, not an issue report requiring a user reproduction. The PR body supplies direct after-fix CLI, Worker transaction, and operator-subprocess evidence for the changed behavior. Is this the best way to solve the issue? Yes: extracting focused modules while retaining the public launcher is a maintainable direction, and the dead-letter retry remains bounded and fail-closed rather than recovering from a non-atomic cleanup response. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8cdf2a157a04. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…nclaw#1012) * refactor: simplify sweep runtime and recover publication backlog * fix: fence non-atomic dead-letter cleanup * fix: preserve reconciliation counters across retries --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
--local-rangereview and every conservative review/apply mutation guard.gpt-5.6-sol/xhigh; issue-generated jobs keepCLAWSWEEPER_ALLOW_MERGE=0and never automatically merge OpenClaw PRs.Directly inspectable real-behavior proof
Actual rebuilt production CLI
The actual rebuilt production CLI was also executed against a new, committed two-revision Git checkout. A fake Codex executable deliberately exits 1 after recording its actual checkout and GitHub-isolation directory; that expected exit proves the real
review --local-rangepath reached Codex without GitHub credentials:Actual operator subprocess against signed HTTP endpoints
This launches
node scripts/exact-review-dead-letter-operator.mjs --action reconcile --execute --max-targets 1as a separate production subprocess against real local HTTP endpoints. An authoritative cleanup race leaves a second closed target available, but the original one-target cap prevents any mutation of it:Actual Worker/SQLite guarded-resolution transaction
The real
ExactReviewQueueWorker, durable-object SQLite state, and/dead-letters/resolveroute were exercised with one safe row plus one unsafe row. The transaction rejected the entire batch; both dead letters remained open:The actual Worker response in the two-row case was:
{"ok":true,"resolved":0,"skipped":2,"unparked":0}The production subprocess also rejects an impossible non-atomic upstream response without refreshing or recovering any item:
An independent reviewer reproduced a second real race: one closed row is resolved, a later closed-row cleanup races, refreshed GitHub discovery fails, then one invalid row is safely resolved. The actual production operator now retains all completed work in its public totals:
Production failure and bounded rollout evidence
dead-letter cleanup changed during reconciliation; refusing stale recovery: https://github.com/openclaw/clawsweeper/actions/runs/30756033690.EXACT_REVIEW_PUBLICATION_BATCH_DISPATCH_COOLDOWN_MSfrom30000to5000; the configured eight-batch cap, 50 publication slots, eight-item batches, and state-writer fences are unchanged.CLAWSWEEPER_FIX_PR_MODEL=gpt-5.6-solandCLAWSWEEPER_FIX_PR_REASONING_EFFORT=xhigh; bothCLAWSWEEPER_ALLOW_AUTOMERGEandCLAWSWEEPER_ALLOW_MERGEare now0, while automatic issue implementation and fix-PR creation remain enabled.Independent review and finding disposition
resolved=0, skipped=2. The operator now explicitly rejects any future violation of that contract instead of inventing misleading counters or recovering from unsafe partial state.resolved_rows=2,closed_rows=1, andinvalid_rows=1.