Skip to content

fix: keep dead-letter reconciliation running under GitHub throttling - #1144

Merged
steipete merged 2 commits into
mainfrom
steipete/remediation-throttle-skip
Aug 12, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/remediation-throttle-skip

Conversation

@steipete

@steipete steipete commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

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.json had 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_throttled event 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 an always() 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

  • Docker-backed Crabbox receipt: provider=local-container, image node:24-bookworm, fresh PR checkout openclaw/clawsweeper#1144, lease cbx_efa770db5e6d (quick-crab-b89a), exit 0, lease stopped.
  • Reviewed runtime source head: 98fae30ad6336f525b654e90f961e6909b5f61e7; final proof-only head: ab5e594b745cad514b5a9e539dc9ad59b6f1aece.
  • Container provenance and container transcript.
  • Transcript secret scan: TruffleHog 3.96.0, verified,unknown, 0 verified and 0 unverified findings.
  • Container RED: merge-base production child exit 1 on throttled 403. Container GREEN: 6 passed, 0 failed; throttled child exit 0 with skip_reasons.github_throttled, persistent 5xx child exit 1 after three attempts, workflow shape passed.
  • Full pnpm run check: static checks including check:dashboard-strict, all builds and lint lanes, 3,372 tests; 3,363 passed, 9 platform skips, 0 failed.
  • Pre-commit, committed-branch, and proof-bundle Codex autoreviews: no accepted/actionable findings.

Real Behavior Proof

  • Claim: GitHub throttling skips opportunistic queued-run remediation without blocking dead-letter reconciliation, while non-throttle failures remain fatal.
  • Exercised surface: Production scripts/stuck-queued-run-remediation.mjs CLI through its real GITHUB_API_URL transport seam, plus the parsed production reconcile workflow.
  • Scenario / fixture: Loopback HTTP listeners return (1) a 403 installation rate-limit body on first discovery, (2) persistent 503 responses, (3) a generic authorization 403, (4) a malformed successful inventory, and (5) a 429 secondary limit after one successful cancellation. The workflow fixture verifies remediation isolation, drain-before-failure ordering, and absent-artifact tolerance.
  • Command / environment: Crabbox local-container with Docker image node:24-bookworm, Node v24.19.0, pnpm 11.10.0, --no-hydrate, and --fresh-pr openclaw/clawsweeper#1144. The committed run-container-proof.sh swaps 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.
  • Observable result: RED reproduced old exit 1 for the installation-throttle 403. GREEN passed all six scenarios: throttle exit 0 with the structured skip_reasons.github_throttled line 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.
  • Artifact / trace: docs/proof/remediation-throttle-skip/ contains the behavior contract, executed launcher, Docker-backed transcript, provenance receipt, and matching secret-scan receipt.
  • Limits: Transport is loopback HTTP rather than live GitHub mutation, and the workflow is validated structurally rather than by dispatching production. No dashboard or Worker surface changed, so OpenClaw Bay and real-Worker proof are not applicable.

@steipete
steipete requested a review from a team as a code owner August 12, 2026 18:49
@clawsweeper

clawsweeper Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 12, 2026
@clawsweeper

clawsweeper Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 3:32 PM ET / 19:32 UTC.

ClawSweeper review

What this changes

This 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 readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: ab5e594b745cad514b5a9e539dc9ad59b6f1aece

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The focused implementation, direct red/green runtime proof, and structural workflow coverage provide above-average merge confidence.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.
Evidence reviewed 5 items Throttle handling: The remediation CLI catches classified GitHub throttles during discovery and remediation, records a structured skip, and stops further cancellation work; other failures still propagate.
Workflow ordering: The remediation step is allowed to finish with failure, both reconciliation stages remain ahead of the deferred failure step, and absent artifacts no longer create a second failure.
Real behavior proof: The Docker-backed Crabbox transcript records RED against current main's base script and GREEN with all six loopback CLI/workflow scenarios passing, including throttle, authorization, persistent 5xx, and deferred workflow failure behavior.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - This changes scheduled workflow failure sequencing: future edits must preserve the deferred remediation failure step after both reconciliation stages so genuine cleanup faults are not silently lost.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Runtime and regression coverage runtime +130/-42; tests +291/-23 The focused test growth exercises each changed throttle and failure branch rather than relying only on workflow syntax.
Proof bundle 8 proof files; 14 files total Most changed files preserve inspectable Docker-backed behavior evidence for an internal automation change.

Merge-risk options

Maintainer options:

  1. Land with the verified ordering (recommended)
    Accept the bounded workflow-sequencing risk because the exact-head proof covers graceful throttles, hard failures, and reconciliation-before-failure ordering.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: The PR repairs a bounded reliability failure in the scheduled dead-letter reconciliation workflow.
  • merge-risk: 🚨 automation: The patch changes GitHub Actions step continuation, failure propagation, and artifact-upload behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.
  • proof: sufficient: Contributor real behavior proof is sufficient. Docker-backed Crabbox evidence exercises the production CLI through its GitHub transport seam and records both the fixed behavior and preserved hard-failure paths; the final commit only adds proof files.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history identifies steipete as author of the original bounded queued-run remediation feature, and this PR continues that same surface. (role: introduced behavior and recent area contributor; confidence: high; commits: 408c28329c18, 98fae30ad633; files: scripts/stuck-queued-run-remediation.mjs, .github/workflows/exact-review-dead-letter-reconcile.yml)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-12T19:15:04.703Z sha 98fae30 :: needs real behavior proof before merge. :: [P2] Run the behavior proof in the required Crabbox container

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 12, 2026
@steipete
steipete merged commit 3d09c5f into main Aug 12, 2026
23 checks passed
@steipete
steipete deleted the steipete/remediation-throttle-skip branch August 12, 2026 19:35
steipete added a commit that referenced this pull request Aug 16, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant