Repository navigation
refactor: split apply phases and safely accelerate dead-letter recovery - #1014
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, 2:41 PM ET / 18:41 UTC. ClawSweeper reviewWhat this changesThis PR splits the guarded apply workflow into focused modules, changes dead-letter reconciliation to run every five minutes with 100 inspected targets and 10 recoveries by default, and adds regression coverage for bounded recovery and label persistence. Merge readinessThis PR remains necessary: it is a current-head refactor plus a bounded operational-capacity change, not work already present on Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s apply lane reads durable review reports, rechecks freshness and policy fences, then synchronizes GitHub labels and eligible close actions. Its dead-letter operator inventories failed review events, verifies their canonical GitHub targets, resolves terminal rows, and queues a bounded number of safe fresh reviews. flowchart LR
Reports[Durable review reports] --> Apply[Apply workflow]
Apply --> Guards[Freshness and policy guards]
Guards --> GitHub[Label and close actions]
DeadLetters[Dead-letter inventory] --> Canonical[Canonical target discovery]
Canonical --> Recovery[Bounded reconciliation]
Recovery --> Queue[Fresh review queue]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the modular apply workflow while preserving the serialized reconciliation workflow, deployment guard, queue-pressure gate, 100-target discovery limit, ten terminal rechecks, and ten-recovery ceiling. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing automation and changes bounded operating defaults rather than repairing a separately reproducible user bug. The PR body does provide after-change production and subprocess evidence for the altered reconciliation path. Is this the best way to solve the issue? Yes. Extracting the apply phases while retaining the existing policy, freshness, lease, label, promotion, and close fences is a maintainable approach, and the higher reconciliation cadence is constrained by explicit request and recovery limits. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f8543d985cc. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
065a992 to
8b6af4c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…ry (openclaw#1014) Co-authored-by: Peter Steinberger <[email protected]>
Summary
src/clawsweeper.tsto the already-landed 19-line launcher and further reduce the apply orchestrator from 2,945 to 1,990 lines by extracting small, separately testable candidate, policy, promotion, labels, source-freshness, review-activity, review-guard, and close-execution phases.gpt-5.6-sol/xhighwith both automatic merge switches disabled.not_actionable_in_repowhen source/release/provider/renderer ownership proves they are external, instead of being mislabeledmanual_review, requesting private third-party logs, and adding a self-blocking maintainer-review label.Real behavior proof
Production bounded reconciliation after the landed starvation fix
Four successful production runs produced these signed-operator summaries:
{"recovered_targets":10,"resolved_rows":141,"closed_rows":129,"duplicate_rows":2,"inventory_complete":true,"queue_pressure":"idle"} {"recovered_targets":5,"resolved_rows":7,"closed_rows":0,"duplicate_rows":2,"inventory_complete":true,"queue_pressure":"idle"} {"recovered_targets":10,"resolved_rows":17,"closed_rows":0,"duplicate_rows":7,"inventory_complete":true,"queue_pressure":"idle"} {"recovered_targets":10,"resolved_rows":10,"closed_rows":0,"duplicate_rows":0,"inventory_complete":true,"queue_pressure":"idle"}Total: 35 safely requeued reviews, 175 resolved dead-letter rows, 129 closed terminal rows, and 11 duplicate rows. Live inventory moved from 1,391 open dead letters to approximately 1,223 while review and publication lanes continued operating.
Actual signed operator batching proof
Running
/tmp/clawsweeper-dead-letter-cadence-proof.mjsagainst a real HTTP server and the actual operator subprocess confirms the previous and proposed scheduled caps both make 13 GitHub requests: three batched identity GraphQL calls plus ten guarded recovery rechecks. The former regression made 110 requests at the 100-target cap.{"previous_cap":{"max_targets":25,"rest":10,"graphql":3,"github_requests":13,"recovered":10},"scheduled_cap":{"max_targets":100,"rest":10,"graphql":3,"github_requests":13,"recovered":10}}The actual
/tmp/clawsweeper-closed-target-execute-budget-proof.mjssubprocess also proves that 100 already-closed issues require just 13 GitHub requests and 100 closed PRs require just 23 requests, limiting the five-minute worst case to 276 requests/hour, versus the 2,436 requests/hour regression. Intermediate 32- and 40-target PR batches are likewise GraphQL-batched and covered by explicit regression tests./tmp/clawsweeper-operator-default-proof.mjsverifies direct CLI invocation now recovers the same ten items as the scheduled workflow.Actual partial-failure apply proof
Running
/tmp/clawsweeper-partial-label-auth-proof.mjsexecutes the real apply path against a subprocess-backedghmock:P2succeeds, a later impact-label write fails HTTP 401, apply returns a conservativekept_open, and the authoritative report still contains the successfulP2label.{"github_labels":["P2"],"canonical_labels":"[\"P2\"]","label_record_matches":true}The actual
/tmp/clawsweeper-report-label-lease-e2e-proof.mjssubprocess separately provesP2remains durable when its successful write invalidates the owned review lease before the next mutation; apply correctly remains fail-closed.Actual offline local review
Running
/tmp/clawsweeper-local-range-proof.mjsinvokesdist/clawsweeper.js review --local-rangeagainst an actual committed local Git range. Codex starts in the expected checkout with an isolated.gh-emptyconfig and no GitHub/network requirement.{"launcher":"dist/clawsweeper.js","committed_local_range":true,"codex_started":true,"codex_checkout_matches":true,"isolated_gh_config":".gh-empty","expected_fake_codex_exit":1}Actual gpt-5.6-sol/xhigh replay of the QClaw issue
Replaying the complete original issue and first ClawSweeper review from openclaw/openclaw#117838 against the updated policy and actual OpenClaw checkout, while excluding the later maintainer closure, now produces the correct real-model decision:
{"decision":"close","closeReason":"not_actionable_in_repo","confidence":"high","workCandidate":"none","requiresMaintainerDecision":false}The model verified that QClaw
0.2.35.624andqclaw/pool-hy3-previeware absent from the OpenClaw2026.7.2checkout, WeChat is provided by the external@tencent-weixin/openclaw-weixinpackage, and none of the reported QClaw renderer/fallback strings exist in OpenClaw source. Merely citing healthy upstream delivery/fallback files does not qualify as evidence of an upstream defect.Safety and validation
not_actionable_in_repodecision becomesproposed_closewithout maintainer-review routing.CLAWSWEEPER_ALLOW_AUTOMERGE=0,CLAWSWEEPER_ALLOW_MERGE=0,CLAWSWEEPER_ALLOW_FIX_PR=1,CLAWSWEEPER_FIX_PR_MODEL=gpt-5.6-sol, andCLAWSWEEPER_FIX_PR_REASONING_EFFORT=xhigh.