Repository navigation
fix: keep dead-letter reconciliation running under GitHub throttling - #1144
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 3:32 PM ET / 19:32 UTC. ClawSweeper reviewWhat this changesThis PR makes GitHub throttling a graceful stop for queued-run remediation, then lets both dead-letter reconciliation stages run before surfacing non-throttle remediation failures. Merge readinessKeep open: the PR remains necessary and the reviewed patch has no blocking correctness finding. Likely related people: steipete (high confidence; introduced and recently maintained the queued-run remediation surface). Priority: P2 Review scores
Verification
How this fits togetherThe exact-review dead-letter workflow runs optional queued-run cleanup before reconciling dead-letter records and publishing its inventory artifacts. The remediation CLI reads GitHub Actions state and now distinguishes temporary GitHub throttling from failures that must still fail the scheduled workflow. flowchart LR
A[Scheduled reconciliation] --> B[Queued-run remediation]
B --> C{GitHub response}
C -->|Throttle| D[Record graceful skip]
C -->|Other failure| E[Defer failure status]
D --> F[Dead-letter reconciliation]
E --> F
F --> G[Upload inventory]
G --> H[Final workflow result]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the narrow throttle classifier and deferred-failure ordering, with the focused loopback proof and workflow assertions kept aligned to future changes. Do we have a high-confidence way to reproduce the issue? Yes: the Crabbox receipt reproduces the current-main base behavior as an exit-1 throttle failure, then shows the PR's loopback transport scenarios passing on the runtime source head. Is this the best way to solve the issue? Yes: classifying only clear 429 and rate-limit/abuse 403 responses as skips while preserving authorization, malformed-response, and persistent-5xx failures is the narrowest maintainable repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e0dc54438e5e. 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)
|
…1176) Keeps operational health truthful during GitHub-side re-run wedges: a run stuck in pre-queue pending on attempt >= 2 for over 60 minutes is classified wedged_rerun - visible in new fields (wedged_rerun_runs, oldest_wedged_rerun_minutes) but excluded from queued_over_threshold, the same treatment the 24h zombie boundary gives the Aug-7 cancel-500 class, without the day-long false-degraded wait. Production evidence: run 31910632853 (repair publish cluster results, attempt 2) sat pre-queue pending >4.5h; GitHub refused all remediation - cancel and force-cancel both 409 "Cannot cancel a workflow re-run that has not yet queued", rerun conflicted with "already running" - while health reported degraded for a run nothing could touch. The stuck-run remediation script now classifies that 409 signature as a structured skip (skip_reasons.wedged_rerun) per the #1144 conventions instead of a failed remediation. Fresh legitimate re-runs (pre-queue seconds) still count normally; genuinely stuck queued runs still alert - fixtures pin all three cases. run_attempt was already preserved end to end; only typing was needed. Follow-up watch: first production cycles for API-budget impact of the pending-inventory query. Proof: red 3/3 / green 6/6, full gate 3527/0 + dashboard-strict, Crabbox local-container receipt at this exact head, machine-verified provenance. Verdict clean (no actionable findings) on 40f0c39.
What Problem This Solves
Fixes an issue where operators could lose an entire exact-review dead-letter reconcile cycle when opportunistic stuck-run discovery hit GitHub installation throttling. In run 31627576607, the first queued-run inventory request returned a 403 rate-limit response; remediation exited 1, the two reconcile stages never ran, and the always-run artifact upload then produced a second failure because
inventory.jsonhad never been created.Why This Change Was Made
Queued-run remediation now uses the dead-letter operator's extracted shared skip classifier: GitHub 429s and rate-limit/secondary-limit/abuse 403s emit a structured
skip_reasons.github_throttledevent with the request path, stop opportunistic work, preserve completed actions, and exit 0. Generic authorization failures, invalid response shapes, and persistent 5xx responses after three bounded attempts remain hard failures.The workflow keeps remediation early so its existing dead-letter deadline reserve stays meaningful, but isolates its exit status with
continue-on-error. Both reconcile stages run before analways()step re-surfaces a real remediation failure, so the run remains honestly failed without blocking the drain. The always-run artifact upload now ignores an absent file set because checkout, setup, guard, or other early failures can legitimately precede inventory creation.User Impact
Operators can expect a throttled housekeeping probe to yield cleanly while DLQ drain continues in the same cycle. Genuine remediation defects still fail the workflow after reconciliation has had its chance to run.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes an internal housekeeping CLI and workflow sequencing only; it does not change dashboard data, observer routes, queue protocol, or any Bay action boundary.
Documentation Lifecycle
Adds historical proof under
docs/proof/remediation-throttle-skip/; no active, proposed, or compatibility documentation changes.Evidence
provider=local-container, imagenode:24-bookworm, fresh PR checkoutopenclaw/clawsweeper#1144, leasecbx_efa770db5e6d(quick-crab-b89a), exit 0, lease stopped.98fae30ad6336f525b654e90f961e6909b5f61e7; final proof-only head:ab5e594b745cad514b5a9e539dc9ad59b6f1aece.verified,unknown, 0 verified and 0 unverified findings.skip_reasons.github_throttled, persistent 5xx child exit 1 after three attempts, workflow shape passed.pnpm run check: static checks includingcheck:dashboard-strict, all builds and lint lanes, 3,372 tests; 3,363 passed, 9 platform skips, 0 failed.Real Behavior Proof
scripts/stuck-queued-run-remediation.mjsCLI through its realGITHUB_API_URLtransport seam, plus the parsed production reconcile workflow.local-containerwith Docker imagenode:24-bookworm, Node v24.19.0, pnpm 11.10.0,--no-hydrate, and--fresh-pr openclaw/clawsweeper#1144. The committedrun-container-proof.shswaps only the production remediation script to the exact merge-base for RED, restores the PR version for GREEN, and runs the same named scenario suite.skip_reasons.github_throttledline and request path; the mid-run receipt retained the first cancellation; persistent 503, authorization, and invalid-shape cases exited 1; workflow assertions proved both drains precede deferred failure reporting.docs/proof/remediation-throttle-skip/contains the behavior contract, executed launcher, Docker-backed transcript, provenance receipt, and matching secret-scan receipt.