Repository navigation
fix(review): stop retrying incomplete source revisions - #1311
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:28 PM ET / 20:28 UTC. ClawSweeper reviewWhat this changesThe PR maps incomplete-source scan failures to a distinct review exit code and queue completion reason so only the unchanged failed revision stops retrying. Regression provenancePossible regression — probable (reviewed change; known regression link). No predecessor PR is attributed. Merge readinessKeep this PR open for normal maintainer review. The current main branch still flattens incomplete-source failures to exit code 1, while this exact-head patch carries a constrained terminal reason through the workflow and queue; its supplied containerized Worker proof covers terminal consumption, generic retries, and newer-revision fencing. Priority: P2 Review scores
Verification
How this fits togetherExact reviews run from the CLI through the sweep workflow into a Worker-backed durable queue, which leases and completes review jobs. The queue decides whether a failed lease is retried, consumed, or superseded by a newer revision. flowchart LR
Scanner[Source scanner] --> CLI[Review CLI]
CLI --> Workflow[Sweep workflow]
Workflow --> Queue[Exact review queue]
Queue --> Decision{Failure outcome}
Decision -->|Incomplete source| Consume[Consume unchanged revision]
Decision -->|Other failure| Retry[Retry review]
Queue --> Newer[Preserve newer revision]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the narrow typed failure protocol while preserving lease-tuple fencing, newer-revision preservation, and generic retry behavior for every other failure class. Do we have a high-confidence way to reproduce the issue? Yes. The supplied exact-head Crabbox trace drives the production Worker and SQLite queue through terminal, generic-failure, and newer-revision completion scenarios over HTTP. Is this the best way to solve the issue? Yes. A narrowly typed optional completion reason preserves the existing retry protocol for all other failures while stopping only the immutable incomplete-source case. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a65acb1ee9e2. LabelsLabel changes:
Label 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)
|
Exact-head real behavior proof
|
| Scenario | Production-boundary observation |
|---|---|
unchanged incomplete_source |
enqueue 202; claim 200 at revision 1; complete 200 {"ok":true,"requeued":false}; dispatch count remained 1 after settle |
| generic failure control | claim 200 at revision 1; complete 200 {"ok":true,"requeued":true}; a second revision-1 dispatch was observed |
| newer revision control | revision 2 enqueue 202; old revision-1 completion was fenced with 409 {"error":"lease_superseded","superseded_by_revision":2}; next dispatch carried lease_revision:2 |
Crabbox exited 0, required artifact matched once, and automatically stopped the lease.
Redacted JSON transcript
{
"schema_version": 1,
"tested_head": "98b0d7683d2eae06b54dca650e786f7f5beda2f1",
"runtime": {
"boundary": "Wrangler local HTTP -> production Worker -> SQLite Durable Object",
"github_boundary": "loopback deterministic stub"
},
"observations": {
"unchanged_incomplete_source": {
"enqueue_status": 202,
"claim_status": 200,
"lease_revision": 1,
"claim_generation": 1,
"complete": {
"status": 200,
"body": {"ok": true, "requeued": false}
},
"dispatch_count_after_settle": 1
},
"generic_failure": {
"claim_status": 200,
"lease_revision": 1,
"complete": {
"status": 200,
"body": {"ok": true, "requeued": true}
},
"retry_dispatch_lease_revision": 1
},
"newer_revision": {
"enqueue_revision_2_status": 202,
"claim_revision_1_status": 200,
"complete_revision_1": {
"status": 409,
"body": {"error": "lease_superseded", "superseded_by_revision": 2}
},
"next_dispatch_lease_revision": 2
}
},
"result": "pass"
}Limits
- This exercises the actual local Worker and SQLite Durable Object, not the deployed Cloudflare account.
- The GitHub side of the unchanged queue contract is stubbed at loopback; transport, signing, queue persistence, leasing, completion, retry, and supersession are real.
- The scanner itself is intentionally not invoked on this machine; proof begins at the typed workflow-to-queue failure contract changed by this PR.
- OpenClaw Bay is unaffected: this changes mutation-side retry disposition only, while Bay remains an observer-only aggregate reader.
|
@clawsweeper re-review Exact-head real behavior proof is now current in the PR body and available in the redacted Crabbox transcript. It exercises the production Worker and SQLite Durable Object over HTTP at |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
AgentInputScanError: incomplete_sourceas a distinct terminal review failureRoot cause
The scanner already marks
incomplete_sourcenon-retryable, but the CLI flattened every review failure to exit code 1. The workflow and exact-review queue therefore received an indistinguishable generic failure and repeatedly retried/recovered the same immutable head.This change carries one narrow reason across the existing boundaries: CLI exit code
78-> workflowfailure_reason-> exact-queuereview_failure_reason. The queue consumes that leased revision only when the reason isincomplete_source; a newer revision remains pending.Behavior proof
Claim: an unchanged review revision rejected as
incomplete_sourceis terminal, while transient failures still retry and a newer revision is preserved.Exercised surface: signed HTTP enqueue -> production Worker routing -> SQLite-backed
ExactReviewQueueDurable Object -> dispatch -> claim -> complete.Exact-head runtime: Crabbox
0.47.0-46-gfeadcdcc, Podman-backedprovider=local-container, imagenode:24-bookworm, leasecbx_bfcbce5344e3, runrun_34e2b681ae4b, head98b0d7683d2eae06b54dca650e786f7f5beda2f1. Wrangler4.107.0ran the real Worker with Miniflare SQLite Durable Object storage; the GitHub API boundary was a loopback deterministic stub so no GitHub mutation occurred.Observed result: the unchanged terminal completion returned 200
{ "ok": true, "requeued": false }and its dispatch count stayed at one after settling. The generic-failure control returned{ "requeued": true }and produced a second revision-1 dispatch. When revision 2 arrived during a revision-1 lease, the old completion was fenced with409 lease_supersededand the next dispatch carriedlease_revision: 2.Artifact/trace: full redacted proof transcript. Crabbox required and collected
proof/pr-1311-runtime.json; the 968-byte artifact tar SHA-256 isf5ed83b6b79e35a5e6e4445328cbb5891942ae710191bc6613980a7e6edf061d. Crabbox exited 0 and automatically stopped the lease.Commands:
All passed at
98b0d7683d.Limits: this is the actual local Worker and SQLite Durable Object, not the deployed Cloudflare account. GitHub App/token/workflow/item/dispatch calls were served by the loopback stub. The scanner itself was intentionally not invoked on this machine; proof begins at the typed workflow-to-queue failure contract changed by this PR.
Compatibility and operations
Review note
Local hosted-agent review was not run because this machine must not execute the repository's local scanner dependency. GitHub ClawSweeper review is expected on the established PR.