Repository navigation
fix: hold scanner refusals and simplify sweep execution - #1701
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed September 27, 2026, 7:49 PM ET / 23:49 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch retains scanner refusals in the durable review queue, routes broad sweeps and failed-review retries through that queue, and retires per-run shard and immediate-apply controls. Merge readiness✅ Ready for maintainer review Keep open: the linked scanner-refusal loop remains on main. The final-head proof addresses the prior authority concern, and this review found no blocking patch defect. Priority: P1 Review scores
Verification
How this fits togetherClawSweeper sends item events, sweep candidates, and explicit requests to a shared queue. The queue admits individual review workflows and projects their status to the dashboard. flowchart LR
A[Item events] --> D[Review queue]
B[Sweep candidates] --> D
C[Explicit requests] --> D
D --> E{Refusal hold or admission}
E --> F[Review workflow]
E --> G[Dashboard status]
F --> G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Ship the queue-owned hold and staged Worker rollout, then retain terminal failure status in Bay while allowing only the approved release paths. Do we have a high-confidence way to reproduce the issue? Yes. Current main deletes the terminal queue row, and the supplied earlier-main workerd run observed same-source readmission; this read-only review did not execute current main. Is this the best way to solve the issue? Yes. The queue is the admission owner, and the final-head trace exercises both refusal and authorized release through its production boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3a18b3d1a207. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The proof-relay finding is resolved: only POSTs to two exact fixture routes can be forwarded, both destinations are fixed loopback URLs, and redirects are disabled. The current head and rerun HTTPS/Worker proof, including malformed-target rejection, are in the main PR body. Production queue behavior is unchanged. |
|
🦞👀 Re-review progress:
|
Use the shared exact-review queue and separate apply lane. Preserve bounded implementation intake and opaque manual request identities while preventing automatic retries from acquiring explicit release authority.
|
@clawsweeper re-review The PR body now contains the maintainer-approved control retirement, current-head AWS/macOS behavior proof, and disposition of all accepted findings. Please review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The current PR body includes final-head AWS/macOS proof for the accepted command-order finding and rank-up: delayed lower-ID and unordered same-comment versions stay held through the real alarm with no new dispatch, while a newer command releases. Failed numeric and opaque manual request identities are fenced as well. All accepted findings are addressed, and the full committed-branch review is clean through P2. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review The current body contains the final-head AWS trace for automatic-origin, command-origin, and in-flight successor cases. All re-review timestamps must be strictly later than the actual refusal and failed command timestamp; there is no ID tie exception or lease-start backdating. Each forbidden case remains parked through the real alarm with zero review dispatches for that item, and a later command is admitted. All accepted findings and rank-up proof requests are addressed; the full committed-branch review is clean through P2. |
|
🦞👀 Re-review progress:
|
Terminal scanner refusals currently delete their queue row, so later events, sweeps, or recovery can review the same item again and repeat notifications. Retain the existing row as a durable
scanner_refusedhold and make the shared queue the hosted review admission owner.Fixes #1455. Implements the maintainer's durable-hold decision: #1455 (comment). Thanks @yetval for the report and reproduction.
Behavior and simplification
Automatic source changes, comments, close/reopen, alarms, and closed/source recovery preserve the hold. A fresh verified re-review, a new explicit manual request, or an intentional
EXACT_REVIEW_RETRY_POLICY_EPOCHchange can release it. Ordinary deploy, model, and prompt changes cannot. Release advances the revision and replaces failed command authority.Verified command timestamps must be strictly later than both the refusal and any failed command timestamp. GitHub has second precision, so all same-second requests stay held regardless of command ID or refusal origin; a new command or edit in a later second can retry. Failed manual delivery identities remain fenced after receipt expiry for numeric and named/UUID IDs. Old workflow reruns cannot become new retries. Independent retryable and source-incompatible failures retain their behavior.
The maintainer explicitly approved retiring broad manual sweep sizing and immediate-apply controls. Remove
batch_size,shard_count, the threeapply_after_review*inputs, five unreachable matrix/recovery/publication jobs, and the unused runtime-packaging helper. Broad sweeps offer candidates under shared capacity; the separate apply lane owns closing. Explicit selection, target branch, hot intake, timeout, and additional prompt remain supported, including nested repository-dispatch options and their legacy flat fallbacks. The PR removes 1,258 net lines.Automatic failed-review retries use repository dispatch, preserving source pins and options. Issue retries reject changed source before model work and retain the post-hydration guard. Retry workflow refs must match the workflow repository default branch; other refs are rejected explicitly. Repair follow-ups surface dispatch failure instead of falling back to a manual workflow that could acquire explicit retry authority. Historical dispatch receipts remain readable.
Existing exact publication hooks and strict-bug backfill remain. The planner offers canonical vision-fit OpenClaw reports under their separate opt-in and viable reports from other eligible repositories through the shared bounded implementation dispatcher. Manual record/comment-only reports remain ineligible for implementation. No new table, scheduler, timer, fingerprint registry, or dependency.
Real behavior proof
Candidate:
7fd5bb4307c7f811566480cec02876c735313a72. Reproducible contract:docs/proof/scanner-refusal-hold/README.md.Commands: frozen install,
pnpm run build:all,node scripts/e2e/scanner-refusal-hold.mjs,node scripts/e2e/exact-review-noop-read-scope.mjs --scenario retry:issue-source-current --scenario retry:issue-source-changed, andnode scripts/e2e/implementation-backfill.mjs.Passed on macOS with Node 24.21.0 and on Linux through Crabbox provider
aws, imageami-0461d919be7deb53c, classc7a.8xlarge, leasecbx_5aa883234b54. Final-head AWS run: https://crabbox.openclaw.ai/portal/runs/run_b0d176eaabb3a873045519d4b81d536e. Exit 0; lease confirmed released. The exercised production source hashes match the committed candidate.The proof uses real workerd/SQLite persistence, signed production Worker HTTP routes, the actual planner Bash, and compiled enqueue/admission/discovery CLIs. Base
420da22ea0f2844e495eed9844c8b283fe63e8b7permitsqueued:trueafter terminal completion. Candidate returnsscanner_refused, retains the row through restart and automatic producer/source variants, and makes no review dispatch on the real alarm. Fresh verified/manual requests release once; policy epoch release advances the revision without old authority.The final authority-chain proof covers automatic-origin and command-origin refusals plus an in-flight successor. In the third case, the verified command is timestamped after lease claim but before refusal: completion returns
requeued: false, and the row stays parked. Every path uses the actual refusal time; lease start never backdates the cutoff. Production alarms produce no review dispatch for the held item, and a strictly later command is admitted. These are actual redacted observations from the final-head AWS run (authority_proofin the printed result):2026-09-27T23:28:48.649Z2026-09-27T23:28:48.000Z2026-09-27T23:28:49.000Z: admitted2026-09-27T23:28:49.133Z2026-09-27T23:28:48.035Z2026-09-27T23:28:50.000Z: admitted2026-09-27T23:28:46.260Z2026-09-27T23:28:46.000Z2026-09-27T23:28:47.000Z: admittedDispatch observations are captured before each later-command positive control and scoped to the held item. Terminal command acknowledgements are separate control work; other deliberately admitted items can progress in the same alarm.
The numeric-ID regression was reproduced before its fix and now rejects the failed request even when its API ID exceeds the worker run ID. A distinct request is admitted. The same-second rule uses one strict chronological threshold, with no comment-ID ordering exception.
Matching issue pins proceed; changed pins stop before model work. Planner capacity/allocation/fallback and preserved options are exercised. The shared implementation dispatcher discovers both retained candidate classes through the compiled production CLI, excludes manual-only reports, and respects the dispatch cap; only GitHub writes are captured locally.
Queue source SHA256:
98187591c7f7467e252342aadfae640a5669fe2425f97cb5624c2149e89b0dcf. Workflow SHA256:b4ce5333db0e5afb01bd9585d8e8a78534bbb1aa2c6058841a019bd9b24cd321. Artifacts:result.json, boundedtrace.json, and Worker log under.artifacts/scanner-hold-HaKlX6on AWS and.artifacts/scanner-hold-9BXN9Gon macOS. Fixture keys are never published.Limits: seeded leases, synthetic loopback GitHub, and already-verified command metadata; no live scanner, complete hosted sweep, contributor mutation, or changed permission-verification boundary. The fixture admission burst is 60 to isolate scenarios from unrelated rate limiting; production limits are unchanged. Optional JSON metadata requires no SQL migration; existing rows lacking the hold field are exercised.
Review disposition and validation
Accepted findings and rank-up work are resolved: the broad-run operator transition is explicitly approved; implementation backfills and nested options are preserved; all ambiguous tied-timestamp commands and pre-refusal in-flight successors are fenced with final-effect proof. The earlier relay finding is fixed with POST-only constant loopback destinations, redirects disabled, and real negative HTTPS requests.
Focused hold, planner, router, admission, and manual-authority checks pass, along with build, static checks, lint, and actionlint. Precommit reviews are clean through P2. The retired-fallback assertion was corrected, and the complete hosted suite passed on the preceding candidate. The focused strict-timestamp tests, dashboard build/lint, and current-head runtime proof also pass. The final committed-branch review is clean through P2. Current-head CI, CodeQL, production automerge testing, and the refreshed ClawSweeper verdict are required before landing.
Bay and rollout
Bay is affected only in projection: held items consume no active review capacity and show no waiting review card; their failed lifecycle remains terminal, and public parked counts include
scanner_refused. The runtime proof covers this. Bay remains observer-only with no retry or mutation control.The normal Worker deployment protects newly observed refusals. Previously deleted rows are not inferred as holds; already-running older direct workflows remain a rollout limit. Verify the deployed Worker SHA after merge. Landing and deployment are authorized in the maintainer conversation; no product decision remains pending.