Repository navigation
fix(review): recover scheduled enqueue from transient queue failures - #1416
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 6:46 AM ET / 10:46 UTC. ClawSweeper reviewWhat this changesThis PR makes scheduled review enqueue retry transient response-loss failures by replaying a durable, authenticated admission result for the identical request. Merge readiness⛔ Blocked before merge - 3 items remain Keep open for maintainer review: the base/current main does not contain this replay behavior, and the PR supplies a focused, proof-backed implementation, but it is Member-authored and changes a durable queue protocol that needs explicit rollout approval. Priority: P2 Review scores
Verification
How this fits togetherScheduled-review plans send signed enqueue requests through the Worker to the Exact Review Queue Durable Object. The queue admits or sheds work, stores delivery receipts, and returns a status capability that the scheduler uses before retrying. flowchart LR
A[Scheduled review plan] --> B[Signed enqueue request]
B --> C[Worker authentication]
C --> D[Exact Review Queue]
D --> E[Durable admission receipt]
E --> F[Replay or conflict response]
D --> G[Queue status capability]
Decision needed
Why: The implementation deliberately changes retry and receipt behavior across the scheduler, Worker, and Durable Object, so acceptance of the temporary fail-closed rollout posture is an operational decision. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Deploy the capability-gated Worker and scheduled producer together or Worker-first, preserving fail-closed behavior for any older queue deployment. Do we have a high-confidence way to reproduce the issue? Yes: the supplied exact-head Crabbox trace injects response loss after queue commit through the Worker adapter and records a matching retry replay plus an altered-byte conflict. Is this the best way to solve the issue? Yes: storing a closed scheduled-only disposition alongside the authenticated receipt is narrower than broadening generic delivery-receipt retries and preserves legacy fail-closed behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 934d526e73e0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
e7dc02d to
843078f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Maintainer rollout decision: approved. The temporary fail-closed window is accepted. Merge the capability-gated Worker and scheduled producer together; the automatic |
Related: #1372
What Problem This Solves
Fixes an issue where scheduled review enqueue could commit in the Worker but lose the HTTP response, causing the producer's retry to receive an ambiguous delivery receipt and abort the plan even though admission had already happened.
Why This Change Was Made
The Worker now fingerprints the exact authenticated scheduled-enqueue bytes and atomically stores a closed queued, scheduled-item-deduped, backpressure-shed, or scheduled-rate-shed disposition with the delivery receipt. A matching delivery ID and fingerprint replays the exact stored response; different authenticated bytes return HTTP 409; legacy receipts without a fingerprint remain ambiguous and fail closed in the producer.
The public queue projection advertises
scheduled_feed.enqueue_replay: scheduled_disposition_v1, which the scheduled producer requires before posting. Only scheduled enqueue uses the existing bounded three-attempt transport/5xx retry. Publication and other post-effects remain single-attempt.No workflow, queue limit, dead-letter, concurrency, or generic delivery-receipt behavior changed. The additive nullable delivery columns do not bump the storage schema version.
User Impact
Maintainers can expect scheduled review plans to recover from a lost response without duplicating queue admission, shed accounting, or logical attempted counts. Rollout fails closed until the Worker advertises the exact replay capability.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. The public queue status gains one bounded scheduler capability field, but Bay activity, lifecycle projections, references, and mutation boundaries are unchanged; the strict projector retains only the rate and capability.
Documentation Impact
Updated
docs/scheduler.mdwith the capability gate, byte-stable retry contract, legacy fail-closed behavior, and the explicit publication post-effect exclusion.Evidence
843078fc9b5ad2cd6b68edb8429e1db92107d0a6934d526e73e032ece6fcd23f374be9895dffd71boxfmt,git diff --check, and privacy scrub: passed.pnpm run checkcould not start because pnpm attempted to purge the shared symlinkednode_modulesand aborted without a TTY. The shared install was not mutated; exact-head hosted CI is the canonical fullpnpm run checkgate.pnpm check, sparse repair build, Windows launcher, CodeQL, and hosted-target rejection checks: passed.run_8ce36a7d9fcb, leasecbx_8bfc59824297: passed on the pinned local-container image below. Redacted artifact member.artifacts/pr1416-local-container-proof.json; archive SHA-256cf8b96d5d9d625b313ac2416e4b5d4e77356df8911b24a7124eb5eb15c898418.Accepted review finding:
delivery_receiptscope was added.Rank-up moves:
Real Behavior Proof
Claim: A scheduled enqueue whose response is lost after the Worker/DO commit retries with identical signed bytes and receives the exact original disposition; altered bytes conflict without retry.
Exercised surface: Built scheduled producer and shared queue client over a loopback HTTPS server, forwarding through the actual Worker fetch adapter into the in-memory Durable Object implementation.
Scenario: The fixture destroyed the first TLS connection only after the Worker/DO returned a committed queued response. The producer retried. It then sent one separately signed request with the same delivery ID but one extra byte.
Command/environment: Fresh PR checkout in Crabbox local-container run
run_8ce36a7d9fcb, leasecbx_8bfc59824297, with 4 CPUs, 8 GiB memory, Node 24.20.0, and pinned imagenode:24-bookworm@sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2. The fixture used a generated one-day loopback certificate; TLS verification was disabled only inside the isolated fixture process.Observed result:
{ "source_head": "843078fc9b5ad2cd6b68edb8429e1db92107d0a6", "provider": "local-container", "image": "node:24-bookworm@sha256:be23f54a88d34e8824c741b19b91064094f92c1c97b194144bfc8b50d67258e2", "limits": { "cpus": 4, "memory": "8g" }, "node": "v24.20.0", "https_fixture": true, "committed_response_lost": true, "retry_attempts": 2, "request_body_sha256_count": 1, "unique_retry_signatures": 1, "replay_response_bytes_equal": true, "summary": { "lane": "normal_backfill", "offered": 1, "attempted": 1, "queued": 1, "deduped": 0, "shed": 0, "rateLimited": 0, "backpressured": 0, "rejected": 0, "deferred": 0, "ageHours": { "p50": null, "p90": null, "max": null } }, "conflict_status": 409, "conflict_body": { "error": "exact_review_delivery_conflict" }, "conflict_attempts": 1 }Limits: This used the real Worker routing and Durable Object adapter with in-memory storage inside an isolated local-container lease, not the production Cloudflare deployment. It did not mutate GitHub, the production queue, or OpenClaw Bay.