Repository navigation
fix(ci): auto-remediate demonstrably stuck queued runs - #1131
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:42 AM ET / 04:42 UTC. ClawSweeper reviewWhat this changesThe PR replaces the hourly queued-run janitor with guarded remediation in the five-minute dead-letter reconciliation workflow, including bounded discovery, cancellation revalidation, and persistent zombie-run state. Merge readinessKeep open for normal maintainer review: the patch has sufficient bounded real-behavior proof and no actionable correctness finding from this review. Priority: P1 Review scores
Verification
How this fits togetherThe dead-letter reconciliation workflow maintains exact-review queue health. It reads GitHub Actions run state, identifies demonstrably stranded queued runs, requests bounded cancellation, and records results for later passes. flowchart LR
A[Queued workflow runs] --> B[Dead-letter reconcile workflow]
B --> C[Eligibility and deadline checks]
C --> D[Revalidate queued state]
D --> E[Cancel or force-cancel]
E --> F[Zombie state artifact]
F --> G[Next reconciliation pass]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the consolidated remediation path with its existing eligibility guards, cancellation cap, deadline reserve, and persistent audit artifacts so stranded runs recover without broad janitor behavior. Do we have a high-confidence way to reproduce the issue? Yes. The current-head proof runs the production remediation script against a loopback GitHub API and demonstrates both successful recovery of one stranded run and safe permanent-zombie handling after two HTTP 500 responses. Is this the best way to solve the issue? Yes. Consolidating guarded remediation into the existing serialized reconciliation cadence removes the broad janitor while preserving explicit eligibility, bounded work, and audit state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6bf7f483fb03. 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)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(ci): auto-remediate demonstrably stuck queued runs This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Summary
Replace the broad hourly 24-hour queued-run janitor with guarded remediation in the existing five-minute exact-review dead-letter reconcile cadence.
The selector cancels a run only when all of these are true:
queued.in_progressorcompleted.repair-cluster-worker.ymllane is excluded.Each pass cancels at most ten candidates. Regular cancellation is tried first; force-cancel is attempted only after HTTP 500. A second HTTP 500 persists the run in the rolling artifact so later passes do not retry it. The old
.github/workflows/queued-run-janitor.ymlis removed so cancellation has one owner.Bounded discovery and deadline
Workflow-history discovery now has two independent bounds:
min(step start + 120,000 ms, EXACT_REVIEW_RECONCILE_DEADLINE_MS - 480,000 ms).The eight-minute reservation leaves budget for live-guard verification and both dead-letter reconciliation stages. Inventory pagination, history pagination, queued-state revalidation, regular cancellation, and force-cancellation all use the remaining total deadline rather than starting a fresh 20-second request budget. Deadline exhaustion produces a successful partial artifact and step summary with
deadline_reachedplus distinct, inspected, and skipped workflow counts, including bound-versus-deadline attribution.The timeout regression runs the production script against 20 distinct stale workflows whose history provider takes 20 seconds per request. It stops after one attempted request in about 1.5 seconds, reports one inspected and 19 skipped workflows (12 by the eight-workflow bound and seven by deadline), and preserves the full 480,000 ms dead-letter reserve.
Production-script behavior proof
Current pushed head:
5ea082af48af27e9e3d6c807d77567b7226f8a7e.Docker-backed Crabbox
local-containerproof used a fresh checkout of this PR, asserted the exact head, and ran the production script through a loopback GitHub API usingGITHUB_API_URL.cancel_requested, and never addressed the young run.permanent_zombie, made no cancellation request, and left the young run untouched.Final current-head confirmation: provider
local-container, leasecbx_8d58967d196f, slugpearl-hermit-2887, Docker imagenode:24-bookworm, exit 0, lease stopped. It passed 71/71 focused tests, all three loopback assertions, static policy/documentation/format checks, all TypeScript builds, and every lint lane.The committed receipt and redacted request trace are in
docs/proof/stuck-queued-run-remediation/container-receipt.jsonanddocs/proof/stuck-queued-run-remediation/loopback-proof-receipt.json. The receipt-producing run tested code headb46b579b6d12d940cb068b32da20a23e8c39b000; the docs-only receipt commit advanced the PR to the current head above, which the final lease then re-proved without further branch changes.The broad host gate also passed on Node 24: 3,345 tests, 3,336 passed, nine platform-skipped, zero failed, with coverage and all static/build/lint gates green.
Limits: the after-fix mutation transport is a loopback fixture, not a production cancellation. The earlier live read-only inventory remains committed and selected no production run.
Production evidence and safety
Two incidents establish the failure mode and remediation:
workflow_cancelledretry path.OpenClaw Bay
Not affected. This changes a GitHub Actions maintenance lane and its private summary artifact only. It does not change Bay's observer-only contract, dashboard data, or expose queue/workflow actions on Bay.