Repository navigation
fix(queue): recover publication claims after transient failures - #1389
Conversation
9180e58 to
3a5ba4d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 9:13 PM ET / September 4, 2026, 01:13 UTC. ClawSweeper reviewWhat this changesThis PR retries dispatched signed publication-claim requests after transient failures and replays an already-created lease after concurrent admission work completes. Merge readiness✅ Ready for maintainer review Keep this member-authored PR open for normal maintainer review. Current main does not contain its retry or post-admission lease-replay changes, and the introduced patch is a focused, plausibly correct repair with targeted coverage. Priority: P2 Review scores
Verification
How this fits togetherThe exact-review publication queue turns dispatched workflow claims into leased batches of review artifacts for publication. The queue client submits signed claims, the Worker rechecks target visibility, and the resulting lease is consumed by the publication runner. flowchart LR
A[Publication workflow] --> B[Signed claim client]
B --> C[Queue claim endpoint]
C --> D[Target admission check]
D --> E[Durable batch lease]
E --> F[Publication runner]
B -->|transient failure| B
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Retain the bounded, byte-identical retry and durable lease replay so transient response loss recovers without changing batch identity or broadening publication behavior. Do we have a high-confidence way to reproduce the issue? Yes—current-main source makes dispatched claims single-attempt, and the focused fixtures deterministically exercise the timeout and HTTP-500 path that the patch changes. Is this the best way to solve the issue? Yes—the repair reuses the existing signed request, bounded retry transport, durable batch identity, and target-admission rules instead of adding a parallel recovery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8440386ebd92. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
🦞👀 Pull request received. I will update this pull request when review starts. |
What Problem This Solves
Fixes an issue where a dispatched publication workflow could lose a claim response during a transient Worker or network failure, exit without a lease, and leave already-reserved publication work waiting for later recovery.
Why This Change Was Made
Dispatched claim requests now retry transient network, timeout, and HTTP 5xx failures up to three attempts within the existing 45-second request budget. Retries reuse the exact serialized body and signature.
The Worker rechecks for an already-created lease after asynchronous target admission and replays the complete existing-batch admission path. The batch store remains the single transactional owner, so the same batch ID and lease owner can create at most one lease.
Undispatched claims, completion requests, post-effects, workflow behavior, capacity, batch size, schema, and configuration remain unchanged.
User Impact
Maintainers should see fewer failed publication runs and less delayed backlog recovery when a claim succeeded server-side but its response was lost.
OpenClaw Bay Impact
Bay is unaffected. This changes only the signed internal claim transport and existing-batch replay path; public projections, fields, and observer behavior are unchanged.
Documentation Impact
Reviewed
docs/live-dashboard.md. No documentation change is required because the public queue contract, operator controls, configuration, and projection fields are unchanged. The retry is bounded internal transport recovery for dispatched claims.Evidence
3a5ba4d056590aab12747d7be03c8c81559bef9772041f31e1d34cff19f50da4b23c4a22a78c828a+56/-43, net+13.+237/-0.build,build:repair, andbuild:dashboard: passed.test/repair/exact-review-batch-queue-client.test.tstest/exact-review-publication-batches.test.tstest/dashboard-worker-queue-runtime.test.tsoxlint: passed.oxfmt --check: passed.check-active-surface,check-dashboard-queue-boundary, andcheck-dashboard-strict: passed.git diff --check: passed.Regression coverage includes:
server_timeto advance;The broad local
pnpm run checkwas not rerun. A previous attempt on this worktree hung in unrelated test infrastructure after about 11 minutes; this branch instead uses the focused owner-boundary suites and targeted static gates above. Hosted CI remains required.Real Behavior Proof
Claim: the built queue client retries a transient dispatched-claim HTTP 500 while preserving the exact request identity, then accepts the returned lease.
Surface: Node 26.7.0 running
dist/repair/exact-review-batch-queue-client.jsagainst an ephemeral local HTTPS server. The server captured each received body and signature and returned HTTP 500 before a successful lease response.Command: an inline Node ESM proof imported the built client, started an ephemeral loopback HTTPS server with a synthetic key and webhook secret, issued one dispatched claim, and asserted the received bytes, HMAC, attempt count, and returned batch identity.
Observed result:
{"result":"pass","attempts":2,"identical_body":true,"identical_signature":true,"claimed_batch":"proof-claim","server_time_preserved":true}Limits: this proves the built client and real HTTPS request boundary locally, including current main's internal
server_timeresponse field. The Worker concurrency and SQLite lease replay are covered by the focused production-queue harness tests; this draft does not claim deployment or a live queue mutation.No deployment, queue dispatch, cancellation, retry, capacity change, or other live operation was performed.