Skip to content

fix(dashboard): classify wedged pre-queue reruns - #1176

Merged
steipete merged 6 commits into
mainfrom
steipete/wedged-rerun-classification
Aug 16, 2026
Merged

steipete merged 6 commits into
mainfrom
steipete/wedged-rerun-classification

Conversation

@steipete

@steipete steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Classify unremediable GitHub Actions reruns stuck in the pre-queue pending state as wedged_rerun after 60 minutes when run_attempt > 1. They stay visible through aggregate status fields but no longer count as live queue pressure. The stuck queued-run remediation CLI discovers aged pending reruns, emits the structured skip before cancellation, and also turns GitHub's exact pre-queue cancellation 409 into skip_reasons.wedged_rerun with exit 0.

Production evidence

Run 31910632853 ("repair publish cluster results", created 2026-08-15T21:52Z): status=pending,
run_attempt=2, stuck >4.5h in PRE-QUEUE state. GitHub refuses every remediation: cancel and
force-cancel both 409 "Cannot cancel a workflow re-run that has not yet queued"; rerun
conflicts with "This workflow is already running". operational_health counts it in
queued_over_threshold → status=degraded for up to 24h until the zombie boundary excludes it,
even though NOTHING can remediate it. (Same family as the Aug-7 HTTP-500 cancel zombies the
24h boundary already handles — see the comment block in dashboard/operational-health.ts.)

Production run: https://github.com/openclaw/clawsweeper/actions/runs/31910632853

Behavior and data contract

The 60-minute threshold is deliberately conservative: pre-queue pending normally lasts seconds, while one hour leaves ample margin for transient scheduling delay. The comparison is strict, so exactly 60 minutes remains ordinary queue pressure. Fresh reruns and genuinely queued over-threshold runs retain their existing behavior.

The Actions list path already passes full run objects to the summarizer. The webhook read model persists and returns the bounded full workflow-run snapshot, and stale revalidation replaces it with the full exact-run API response. run_attempt was not being dropped; this change records it in the local types without a storage migration. Remediation now queries both queued and pending inventories, admits only pending attempts greater than one beyond its existing strict 90-minute stuck threshold, and exact-rechecks the run before recording a skip without a POST.

Public status exposes only wedged_rerun_runs and oldest_wedged_rerun_minutes. The containment fixture proves run IDs and diagnostic URLs are removed. The dashboard mentions wedged reruns distinctly only inside details when another real execution problem opens the alert.

OpenClaw Bay is unaffected: it does not consume operational_health, and no Bay lifecycle, projection, or observer-action contract changed.

Real-behavior proof

  • Claim: a 90-minute pending attempt-2 rerun is healthy aggregate wedged telemetry; a two-minute rerun stays ordinary; a genuine queued run still degrades; an aged pending rerun becomes an exit-zero skip before cancellation; and the exact cancellation 409 uses the same taxonomy.
  • Exercised surface: dashboard /api/status summarization and public projection, dashboard alert rendering, and the production remediation CLI through its GITHUB_API_URL loopback seam.
  • Environment: Docker-backed Crabbox provider=local-container, image node:24-bookworm, lease cbx_f7e8db6e9e13 (tidal-shrimp-7cbb), run run_463709e0dc4a.
  • Tested source: 0b677cbcca1651b7ea73f83f4f12a0fbf56589c9; merge base 43799a11fc2612df7d80918e0012d6f03b339747; final PR head 40f0c392f9b031883e4aaa5624302582f1a02aae adds refreshed receipt files only. The repaired source and receipt commits were pushed together.
  • Observable result: merge-base red failed all three new claims; source-head green passed six focused scenarios, including pending discovery, exact pending recheck, structured skip, and no cancellation POST; check:dashboard-strict passed; full pnpm run check passed 3,535 tests with 3,527 passed, zero failed, and eight skipped.
  • Artifact: docs/proof/wedged-rerun-classification/ contains the contract, source-blind behavior report, normalized transcript, provenance, secret scan, and reproducible launcher. Static jq, SHA-256, git cat-file, and merge-base checks pass.
  • Limits: GitHub API behavior uses loopback fixtures. Production run 31910632853 was not mutated.

Review disposition

ClawSweeper's first current-head review accepted one P1 finding: the production pending state could not reach the original cancellation-response classifier. Fix round 1 now queries the pending inventory, selects only aged rerun attempts, exact-rechecks live state, records wedged_rerun before cancellation, and proves no POST is sent. The exact 409 fallback remains covered for queued-looking responses. Focused, proof-only, and final committed-branch Codex reviews after the fix reported no additional accepted or actionable findings. No CHANGELOG.md change is included, as requested.

Rank-up moves: both requested moves are applied. The production CLI loopback now uses a discovered and freshly read pending run, and the Docker-backed receipt was refreshed for the repaired source head.

@clawsweeper

clawsweeper Bot commented Aug 16, 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. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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 16, 2026
@clawsweeper

clawsweeper Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:44 PM ET / August 16, 2026, 03:44 UTC.

ClawSweeper review

What this changes

The PR classifies aged pending GitHub Actions reruns as wedged telemetry rather than live queue pressure and records their unremediable cancellation result as a structured skip.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: current main does not contain this focused repair, and the current PR head has no actionable correctness finding. The submitted receipt supplies sufficient real-behavior proof for the dashboard and remediation paths.

Priority: P1
Reviewed head: 40f0c392f9b031883e4aaa5624302582f1a02aae

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) The patch is focused, has no actionable review finding, and is supported by unusually strong red/green real-behavior evidence.
Proof confidence 🦀 challenger crab (6/6) ✨ media proof bonus Sufficient (linked_artifact): A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.
Evidence reviewed 5 items Current-main gap and implementation: The checked-out main is 43799a1, while the PR changes both operational classification and remediation behavior. A pending rerun is excluded only when its attempt is greater than one and its age strictly exceeds one hour.
Pending reruns are safely handled before cancellation: The remediation selector admits only aged pending reruns with attempts above one, and the execution path exact-rechecks the run before recording a skip without a cancellation POST.
Read-model path preserves the needed workflow fields: The Worker already treats pending as an active operational status and passes reconciled active workflow snapshots into the health summary; this PR adds the local run-attempt typing and public aggregate fields.
Findings None None.
Security None None.

How this fits together

The dashboard Worker collects active GitHub Actions runs, derives operational queue health, and publishes a privacy-filtered status response for the dashboard. The remediation CLI separately inventories stale runs and either requests cancellation or records a safe structured skip.

flowchart LR
  A[GitHub Actions runs] --> B[Dashboard Worker]
  B --> C[Operational health summary]
  C --> D[Public status API]
  C --> E[Dashboard alert]
  A --> F[Remediation CLI]
  F --> G[Cancel or structured skip]
Loading

Before merge

  • Resolve merge risk (P1) - The remediation pass now scans an additional paginated pending-run inventory; throttling is handled as a structured skip, but the first production run should be observed for GitHub API-budget impact.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Diff composition 20 files; production +144, tests +318, proof/docs +7,062 The runtime change is bounded, while the large receipt bundle makes source-to-proof linkage especially important to review.
Behavior proof 6 focused scenarios; 3,527 passed of 3,535 The receipt demonstrates merge-base failures and after-fix behavior through the dashboard and production CLI seams.

Merge-risk options

Maintainer options:

  1. Accept the bounded inventory expansion (recommended)
    Land with normal check gating and observe the first production remediation run, since throttling already exits through the existing safe structured-skip path.

Technical review

Best possible solution:

Land the narrow classification and skip behavior once normal required checks finish, retaining the aggregate-only public status contract and exact cancellation fallback.

Do we have a high-confidence way to reproduce the issue?

Yes: the receipt captures the production CLI and dashboard paths against loopback GitHub API fixtures, with the merge-base failing the three new claims and the repaired source passing them.

Is this the best way to solve the issue?

Yes: classifying only aged pending reruns with attempts above one, then exact-rechecking before a no-POST skip, preserves ordinary queue pressure and avoids unsafe remediation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 43799a11fc26.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦀 challenger crab 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): A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.
  • 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:

  • P1: This repairs live workflow-health and remediation behavior for an observed wedged GitHub Actions rerun.
  • merge-risk: 🚨 automation: The PR changes GitHub Actions polling, dashboard health classification, and remediation outcomes.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦀 challenger crab 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): A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.
  • proof: sufficient: Contributor real behavior proof is sufficient. A Docker-backed Crabbox receipt exercises the real dashboard and production CLI boundaries with loopback GitHub responses, records merge-base failures and after-fix recovery, and is linked to the final head through proof-only receipt refreshes.

Evidence

What I checked:

  • Current-main gap and implementation: The checked-out main is 43799a1, while the PR changes both operational classification and remediation behavior. A pending rerun is excluded only when its attempt is greater than one and its age strictly exceeds one hour. (dashboard/operational-health.ts:125, 40f0c392f9b0)
  • Pending reruns are safely handled before cancellation: The remediation selector admits only aged pending reruns with attempts above one, and the execution path exact-rechecks the run before recording a skip without a cancellation POST. (scripts/stuck-queued-run-remediation.mjs:67, 40f0c392f9b0)
  • Read-model path preserves the needed workflow fields: The Worker already treats pending as an active operational status and passes reconciled active workflow snapshots into the health summary; this PR adds the local run-attempt typing and public aggregate fields. (dashboard/worker.ts:110, 40f0c392f9b0)
  • Current-head real behavior proof: The Docker-backed receipt hashes to the provenance-recorded SHA-256 and records merge-base failures followed by six focused passing scenarios, dashboard strict validation, and a 3,535-test full gate with zero failures. The final head differs from tested source 0b677cb only in refreshed proof files. (docs/proof/wedged-rerun-classification/container-transcript.txt:142, 40f0c392f9b0)
  • Feature history routing: Prior main history shows Peter Steinberger maintaining the stuck-run remediation path in commit 3d09c5f; the latest reachable health-path history points to Martin Cleary's current-main status work. (scripts/stuck-queued-run-remediation.mjs:1, 3d09c5f72ab2)

Likely related people:

  • Peter Steinberger: Previously landed the current main remediation throttling behavior and authored the focused pending-rerun repair. (role: recent remediation-path contributor; confidence: high; commits: 3d09c5f72ab2, 0b677cbcca16; files: scripts/stuck-queued-run-remediation.mjs, test/stuck-queued-run-remediation.test.ts)
  • Martin Cleary: Current-main history identifies recent work on the operational-health/status surface adjacent to this change. (role: recent status-path contributor; confidence: medium; commits: 43799a11fc26; files: dashboard/operational-health.ts, dashboard/worker.ts)

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-16T03:24:05.640Z sha c8c175c :: needs real behavior proof before merge. :: [P1] Classify pending reruns before canceling

@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 16, 2026
@steipete
steipete merged commit 61276c8 into main Aug 16, 2026
20 checks passed
@steipete
steipete deleted the steipete/wedged-rerun-classification branch August 16, 2026 03:47
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. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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