Skip to content

fix(dashboard): stop status refresh timing out on unfiltered run listing - #2154

Merged
obviyus merged 1 commit into
mainfrom
fix/status-runs-window
Nov 5, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/status-runs-window

Conversation

@obviyus

@obviyus obviyus commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Problem

/api/status goes stale on production. The status refresh reports workflow_runs_unavailable:timeout, and freshness.state stays stale well past its 60s maximum age.

The refresh reads /repos/openclaw/clawsweeper/actions/runs?per_page=100 with no filter, in parallel with the completed listing and the active-status census. All of them share the 18s STATUS_REFRESH_TIMEOUT_MS deadline. With this repository's run history, GitHub is slow on the unfiltered listing. I measured from a maintainer token on 2026-11-05:

Request Latency
actions/runs?per_page=100 (unfiltered) 10.1–10.8s, one HTTP 502
actions/runs?status=completed&per_page=100 3.1–4.8s
actions/runs?status=queued&per_page=100 ~3.7s

Fix

Remove the unfiltered read. It added nothing the other two reads don't already return:

  • completed runs come from status=completed;
  • active runs come from activeWorkflowRunCandidates, which already covers each status in ACTIVE_RUN_STATUS_FILTERS (in_progress, queued, waiting, requested, pending), the same set as ACTIVE_RUN_STATUSES.

The workflow_runs_unavailable diagnostic code no longer has a producer, so it leaves the public allowlist. A cached value with that code now projects as telemetry_unavailable.

Proof

  • node --test on every test file that exercises /api/status or statusSnapshot (dashboard status, status privacy, etag broker and related files): 239/239 pass.
  • New assertion: a status refresh makes zero unfiltered actions/runs requests.
  • The run-read counts in the polling test drop from 7 to 6 per refresh, and from 14 to 12 across two refreshes.
  • lint:dashboard, lint:scripts, check:dashboard-strict and oxfmt --check are clean.
  • The full run-node-tests all suite was still running locally when I opened this PR; CI is the full gate.

The status refresh listed /actions/runs with no filter alongside the
completed listing and the active-status census. On this repository's run
history GitHub takes 10s+ (and sometimes 502s) for that unfiltered read,
so it blew the 18s refresh deadline and left /api/status stale with
workflow_runs_unavailable:timeout. The completed listing and the five
status-filtered censuses already cover every run state, so drop the
redundant read.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes the unfiltered workflow-run listing from dashboard status collection and retires its diagnostic code.

Example: A status refresh has fewer than 100 runs in each active status.

  • Before: The collector requests one unfiltered listing, one completed listing, and five active-status listings.
  • After: The collector requests the completed listing and five active-status listings, with no unfiltered request.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The patch is focused and source review found no actionable defect, but the required runtime behavior proof is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: The dashboard reports stale operational status after refresh failures.
Reason: The host records owner-approved direction, and removing an expensive overlapping request has clear value without adding configuration or another collection path.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes an unnecessary polling request still present on main, and inspection found no definite introduced correctness defect.

Priority: P2
Reviewed head: acbbd88ae07391b53fa64943aa1ee5c9c9adff4e

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied shipped-entry-point run demonstrates after-fix refresh completion and preserved run telemetry under the reported slow-listing conditions.
Agent review details

How this fits together

The dashboard Worker collects GitHub Actions runs and jobs, combines queue telemetry, and publishes a sanitized, cached response through /api/status.

flowchart LR
  A[Dashboard client] --> B[Status endpoint]
  B --> C[Status collector]
  C --> D[Completed run listing]
  C --> E[Active status censuses]
  D --> F[Jobs and health]
  E --> F
  F --> G[Public projection and cache]
Loading

Technical review

Best possible solution:

Use the existing completed and active-status collectors as the sole workflow-run inputs.

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

Source confirms the broad request delays the initial collection barrier; the reported production stall was not independently reproduced, and individual GitHub requests already have a 4.5-second timeout.

Is this the best way to solve the issue?

Removing the broad request is a small, coherent simplification using existing collectors, although the supplied measurements do not establish that it resolves the entire production freshness incident.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 404a96671ce8.

Provenance checked

  • Broad workflow listing and active-run union changes intended behavior with a stated reason (7359bbe: Status-filtered polling was added to count active workflows beyond the broad recent-run page, while retaining that page in the union.)
  • Completed-run union changes intended behavior with a stated reason (d11f439: The completed listing expanded worker-health sampling while retaining completed observations from the broad listing; this PR explicitly removes the broad source because of its cost.)
  • Public failure-code projection keeps the original intent (fix(dashboard): explain GitHub status warnings #2148: Producer-owned bounded causes explain failures without exposing upstream details; historical unknown codes remain generic.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change and current-main behavior: The introduced diff removes the broad request and its merged results; the pinned main implementation still performs that request. (dashboard/worker.ts:6812, acbbd88ae073)
  • Existing collection owner: The existing collector covers all five recognized active statuses, validates pagination completeness, and retains bounded failure diagnostics; completed runs have a separate listing. (dashboard/worker.ts:8438, acbbd88ae073)
  • Polling history and accepted direction: refactor(dashboard): use polling-only workflow health #1926 established polling as the supported workflow-health source; this PR retains that owner and removes one request within it. (dashboard/worker.ts:6817, d803cacea24e)
  • Historical diagnostic compatibility: The existing projection maps unrecognized historical codes to telemetry_unavailable; the changed privacy test explicitly covers the retired code without changing warning counts. (test/dashboard-worker-status-privacy.test.ts:187, acbbd88ae073)
  • Supplied proof and discussion: The complete live PR body and both comments contain test results and pre-fix request measurements, but no after-fix runtime trace or artifact; the body matches the supplied sourceRevision c4e53da1dc8c98cf2e84c15786890de58118ecbbef7ad2ca007a951e93d2a0bc. (acbbd88ae073)
  • Repository policy: The full root policy was applied; no nested policies, maintainer notes, or pr-simplify skill were present in the relevant paths, and the checkout remained clean. (AGENTS.md, acbbd88ae073)

Likely related people:

  • Vincent Koc: Raw commit 0d73170 adds dashboard/worker.ts:6778 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 0d7317009946; files: dashboard/worker.ts)
  • Ayaan Zaidi: Raw commit d803cac adds dashboard/worker.ts:7655 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d803cacea24e; files: dashboard/worker.ts)
  • Peter Steinberger: Raw commit 7359bbe adds dashboard/worker.js:213 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7359bbeba38c; files: dashboard/worker.js)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: Stale dashboard telemetry affects operational visibility, while the change leaves review execution and message delivery untouched.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Stale dashboard telemetry affects operational visibility, while the change leaves review execution and message delivery untouched.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Supply the current-head runtime evidence described in the proof assessment.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 5, 2026, 12:02 AM ET / 05:02 UTC.

@obviyus

obviyus commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Proof: the real /api/status against live GitHub

I ran the real worker.fetch /api/status entry point in-process against live api.github.com. Each run had an empty cache, a fresh in-memory queue and a maintainer token. Three refreshes on main (404a96671) and three on this head (acbbd88ae), run back to back:

Code Attempt Elapsed Diagnostics Active runs Health sample Unfiltered actions/runs reads
main 1 8.6s workflow_runs_unavailable:timeout 20 10 1
main 2 9.0s workflow_runs_unavailable:timeout 18 10 1
main 3 8.5s active_runs_unavailable:census_incomplete 18 11 1
fix 1 6.8s none 18 11 0
fix 2 7.5s active_runs_unavailable:census_incomplete 17 11 0
fix 3 7.6s active_runs_unavailable:census_incomplete 20 10 0
  • Reproduced: main hit the production error in 2 of 3 refreshes. The unfiltered read hits the 4.5s per-request GITHUB_TIMEOUT_MS.
  • Fixed: this head never produced it. Active-run and health telemetry stayed the same, and each refresh is 1–2s faster.
  • Not this change: census_incomplete shows up on both, at the same rate. It's the active-status census noticing that live runs changed mid-read, which is expected while the fleet is busy.

I didn't use wrangler dev because it fails to start on main as well. workerd rejects the named export STATUS_REFRESH_TIMEOUT_MS.

@obviyus
obviyus merged commit 7533acb into main Nov 5, 2026
38 checks passed
@obviyus
obviyus deleted the fix/status-runs-window branch November 5, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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