Repository navigation
fix(queue): retry control-plane 5xx and propagate retryable admission failures - #1497
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 8, 2026, 11:27 AM ET / 15:27 UTC. ClawSweeper reviewWhat this changesAdds bounded retries to workflow control-plane requests, preserves retryable admission responses at webhook ingress, and classifies failed review fences as queue infrastructure failures. Merge readiness✅ Ready for maintainer review This PR remains useful: current main still loses retryable webhook admission responses and lacks the shared workflow retry behavior. The previous merge-conflict blocker is resolved, the supplied runtime proof covers the changed paths, and no actionable introduced defect was found. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper workflows contact a Worker-backed durable queue to admit, claim, fence, and complete reviews. These changes let transient failures recover while preserving the queue’s existing ownership checks and reporting failures accurately. flowchart TD
A[GitHub events] --> B[Worker ingress]
C[Review workflows] --> D[Bounded request retries]
D --> B
B --> E[Durable queue admission and lease checks]
E --> F[Review and publication lifecycle]
E --> G[Status and retry guidance]
G --> D
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep one bounded shell retry policy while preserving endpoint-specific lease conflicts, deployment compatibility, and structured admission responses. Do we have a high-confidence way to reproduce the issue? Yes, from source: main throws away structured non-success enqueue responses, and affected workflow calls can fail on a single transient response. This read-only review did not execute a failing main reproduction. Is this the best way to solve the issue? Yes. A shared bounded helper removes repeated retry loops while the Worker change narrowly preserves existing response semantics; endpoint-specific conflict and deployment-skew handling remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f789a4a58f81. 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)
|
8149a10 to
166bc7b
Compare
…dmission failures (#1497)" (#1498) This reverts commit 9da27d0. Reverts #1497: its helper checkout step leaves core.sparseCheckout enabled so the job's full checkout materializes only scripts/control-plane-curl.sh and setup-pnpm is missing (runs 34246655629, 34246581768). A corrected re-land follows.
… failures (re-land) (#1503) * fix(queue): retry control-plane 5xx and propagate retryable admission failures (#1497) (cherry picked from commit 9da27d0) * fix(queue): retry control-plane 5xx and propagate retryable admission failures (re-land) Re-land the retry and structured admission failure behavior from reverted PR #1497. The original early helper-only sparse checkouts persisted sparse Git configuration into subsequent full checkouts, omitting the local setup-pnpm action. Fetch the helper at the workflow commit into RUNNER_TEMP before source checkout, validate the download and function, and use the repository copy after full checkout. Audit checkout ordering across workflows and full source checkout before sweep setup-pnpm, with executable bootstrap failure coverage and a real Git old/new checkout reproduction. * fix(queue): keep lease cleanup independent of checkout Address the current ClawSweeper finding on #1503: direct lifecycle recovery skips source checkout, while claimed-lease completion must still reach the queue. Bind review completion, publication completion, and terminal retry to the actual checkout outcome. Use the repository helper after success and the already validated temporary helper after skipped, failed, or cancelled checkout. Preserve existing admission, lease, and requeue guards. Exercise the extracted cleanup shells over loopback HTTP for nine successful, skipped, and failed checkout scenarios, including a poisoned partial checkout and checkout-free direct-lifecycle requeue.
What Problem This Solves
Resolves a problem where exact-review workflows fail or skip review after a single transient control-plane 5xx, and visibility admission failures lose their retry signal at webhook ingress.
Why This Change Was Made
The Worker now returns the Durable Object's structured retryable 5xx response intact at webhook enqueue; internal proxies already preserved it and now have explicit regression coverage. One shared shell helper retries connection failures and HTTP 5xx at most four times, honors Retry-After up to 60 seconds, and otherwise waits 2/4/8 seconds. Callers retain their final status, body, curl exit behavior, and explicit 409 handling and the existing one-time 400 deployment-skew fallback. Existing outer curl retry loops are removed.
Visibility admission and credential-bearing live probes are unchanged. Enqueue admission precedes delivery persistence, and earlier webhook gates already return 503; no GitHub redelivery contract depends on the previous opaque 500.
User Impact
Transient control-plane failures can recover within the same workflow attempt. Exhausted reservation and status-fence failures use the existing queue_completion_failure category, so a skipped review is attributed to queue infrastructure.
OpenClaw Bay Impact
No Bay code or public data-contract change is required. This corrects workflow failure attribution using an existing category; Bay's observer-only reads and canonical view links are unchanged. No browser calls or mutation controls are added.
Documentation Impact
Updated the active scheduler reference with shell retry limits and classification, and the active live-dashboard protocol reference with structured admission response propagation. Reviewed webhook delivery/deduplication behavior and the separate batch-publication retry policy; batch clients retain their existing policy. Added the Unreleased changelog entry.
Evidence
Node 24 / pnpm 11.10.0: build, build:repair, build:dashboard, static/documentation checks, formatting, lint, and diff checks passed. Focused Worker/helper/fence tests, loopback terminal-finalization/reconciliation tests, drift-refresh proof, and checkout audits passed.
The first full unit run reported 3 failures among 3,999 tests: stale curl/terminal-attempt fixture assumptions were corrected, and the separate locale/process-identity failure passed on an isolated rerun. The broader coverage check reported 5,608 passed, 13 skipped and 10 failures, including outdated checkout assumptions (now fixed) and separate subprocess/time-budget failures; every reported case has passed focused reruns. The rebased tree builds all bundles, passes 48 focused tests plus the 11-case completion/skew/classification audit, passes the committed-head real-behavior proof and static checks, and has a clean pre-commit review. The full-run failure summary is retained rather than described as a clean run. CI must validate the current head.
Real Behavior Proof
166bc7bd77baa7fb6ecfdcf91e8adfc85916ab8e(rebased onto current main; changelog entries and the existing terminal-reason deployment-skew fallback are retained).node scripts/e2e/control-plane-retries.mjs, Node 24.20.0 on macOS, local Wrangler 4.107.0/workerd, Bash/curl. No remote lease or container image; provider is local-workerd.scripts/e2e/control-plane-retries.mjs; generated transcript and workerd logs in.artifacts/control-plane-proof/. Compact executed output below.Known Gaps
No production deployment or merge is performed by this PR. Shell retries do not add replay authority or change admission policy; the separately implemented batch clients remain outside this change.
Audited 32 control-plane curl sites.