Skip to content

fix(dashboard): recover status polling after stalled reads - #1599

Merged
vincentkoc merged 2 commits into
mainfrom
fix/status-refresh-lifetime-20260916
Sep 17, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/status-refresh-lifetime-20260916

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes Dashboard and OpenClaw Bay polling staying stuck when a status dependency or response body never completes.

User Impact

Status collection returns within its 18-second budget, preserves usable cached status, and lets the next normal poll recover. An unavailable freshness timestamp is shown as “Status freshness unavailable” instead of an invented age.

Merging this PR triggers the existing dashboard workflow, which deploys the Worker and runs its live smoke test.

Why This Change Was Made

The status owner now bounds cache reads, collection and body consumption, stops admitting work at its deadline, and retains shared cleanup through the Worker request lifecycle. Only terminal usable snapshots enter best-effort cache publication. A held older publication cannot block later refreshes; late completed writes retain their original timestamps.

No new configuration or storage schema is introduced. Poll intervals, collection concurrency, authentication sharing, ETag behavior and publication counts stay intact. Production changes are +158 lines for the collection lifetime and cancellation boundary; unit tests are +361 lines, with +530 lines in the executable proof harness.

The branch incorporates current main ab35b4b52172e72245efccd2241b81c2c86e01bc without changing the original dashboard, test, or proof implementation. All upstream changelog entries are preserved.

OpenClaw Bay Impact

The real served Bay and Dashboard both show unavailable status during a held read and recover on their ordinary timers without reloads or substituted browser responses. Bay clears its notice and restores its snapshot timestamp. Dashboard restores its timestamp caption and the fixture's 17 workers, budget 128 and 13% utilization. All four fresh screenshots were visually inspected.

Documentation Impact

The active recipe in docs/proof/status-publication-outcomes/README.md documents the source owner, baseline, replay command and limits. Reviewed docs/live-dashboard.md and docs/state-storage.md; timestamp-based freshness and best-effort snapshot publication remain the existing contract. The operational changelog entry is included.

Evidence

  • Current integrated head: 345f68e1bc89b725a2b30a835e4a2256edb0f851; signed integration tree: 442eadd65a91bf23d27752c4c6a014222a5c1b09.
  • Fresh isolated corepack pnpm run check: passed, including static checks, builds, formatting, lint and coverage; 6,286 tests passed, 19 skipped, 0 failures or cancellations. Changed coverage: 13/13 passed. Native script and runner both exited 0.
  • Privacy/Bay sibling coverage, shared authentication, same-key cold/stale coalescing, body stalls, failed persistence without a Worker context, and late cache replacement are covered by the current suite.
  • Fresh native committed review against ab35b4b52172e72245efccd2241b81c2c86e01bc found no actionable regressions in the diff or affected call paths. Review log SHA-256: b0167f5b0e54b708878310966b0bb1cb321b3fa23ee1656acc5a47e49fff09b3. Runtime proof ran on the isolated box; the Paris worktree remained code-only.
  • Fresh frozen install and runtime receipt pin the package/lock/workspace inputs, explicitly absent .npmrc, .crabbox.yaml, install layout, Node, Wrangler, Playwright and browser executables. All 1,658 tracked inputs were verified before and after validation.
  • Full-check receipt SHA-256: 971ae4c7245eb42596e7fc346bbd147c0daaf160ca9c688adf07fa07745ff648; runtime receipt: 964716940f217a9fabdefcb2108f855a7666c102deeb378e9bd5ebbabc46530d.

Inherited follow-up — mixed URI/Git-metadata fixture provenance: the precommit composition review reproduced a scanner failure when a reviewed URI and qualifying object-ID finding share a patch section. Masking the Git index IDs makes the unchanged URI lose its witness and fail with material_not_reviewed. This is the same src/agent-input-scan.ts blob 3a0f67ea3d9453b893378bb50001a327f15a5967 at current main and this head; the relevant producer is at lines 725–729. It is assigned to the separate scanner provenance repair. It is outside this dashboard lifetime delta and is explicitly recorded rather than silently ignored.

Real Behavior Proof

Claim and surface: A blocked status read cannot hold either public polling client indefinitely, and pending final persistence cannot suppress a later healthy publication.

Scenario and environment: Fresh native isolated AWS execution with Node 24.18.1, pnpm 12.4.1, Wrangler 4.131.1, Playwright 1.63.0 and Chromium 153.0.8010.12, using real loopback HTTP and SQLite-backed StatusStore. Synthetic queue input; Worker outbound traffic denied. Frozen baseline ab35b4b52172e72245efccd2241b81c2c86e01bc.

Command:

node docs/proof/status-publication-outcomes/run-proof.mjs ab35b4b52172e72245efccd2241b81c2c86e01bc --lifetime --capsule <verified-capsule.json>

A reviewed outer supervisor ran that unchanged canonical command in private PID/network namespaces. It required bounded natural descendant reaping and closed sockets, then verified its launched outer process group had gone. The complete script exited 0; stderr was empty; the final artifact hashes matched. No proof retry occurred.

{
  "baseline_pending_ms": [19500, 19500],
  "candidate_read_and_body_ms": [18008, 18005],
  "post_deadline_snapshot_writes": 0,
  "post_deadline_additional_snapshot_reads": 0,
  "healthy_next_refresh": true,
  "held_old_put": {
    "newer_durable_publication_before_release": true,
    "late_old_body_retained_original_timestamp": true,
    "stored_old_body_canonical_freshness": "stale",
    "actual_next_http_selected": "newer fresh snapshot"
  },
  "served_clients": ["Dashboard", "Bay"],
  "automatic_next_poll_recovered": true,
  "unavailable_caption": "Status freshness unavailable · GitHub telemetry is incomplete.",
  "browser_script_errors": 0,
  "natural_process_and_socket_cleanup": true,
  "remaining_owned_processes": 0,
  "production_mutations": 0,
  "source_tree_sha256": "d730c539bf545ee6db393247f8feddd2d715b3dd616f4ab2e203c1ee103d3296",
  "receipt_sha256": "a5ed0d0666197b11257ff5091a791bf56e2ccd0b603157366328197c230f2088"
}

Source binding: The canonical capsule was prepared before the integration commit, so its metadata records precommit head c97007a6baca85817e086b5c3a09166de662a0ec with a dirty candidate. The actual proof verified 450 baseline files and 459 candidate files. After commit, all 459 candidate hashes and all 1,658 tracked manifest entries were compared with the committed Git blobs in 345f68e1bc89b725a2b30a835e4a2256edb0f851 and matched. The full tree is 442eadd65a91bf23d27752c4c6a014222a5c1b09; this is fresh proof for the integrated bytes, not a reuse of the historical c970 run.

Trace/artifacts: The new lifetime-summary-composed-20260917.json and four lifetime-{dashboard,bay}-{unavailable,recovered}-composed-20260917.png files are retained under .artifacts/status-publication-outcomes/, separately from the historical proof. The preserved receipts include:

  • Capsule SHA-256: bea4e8e2f8169df3764c326d9770b97b27f43de557182cabab257749b04c6594.
  • Full source manifest: 785cdb5393424efe9293f25e464736de13c79da276c898c9a2f1f80dddeaa474.
  • Commit binding: 87be34cac1f3a335f9989b3a6795aba2c579e29e5f47f446350ff49e3da76bc5.
  • Namespace cleanup: b8994a46e91f3d47a1af42e358bb18ee114616e9bd88d027882630d8d37f8e75.
  • Outer cleanup and final artifact hashes: 555fb7ce9c43fef4be33baaa4c4c746a7d389758678005e8110476b5c3a1a397.

Limits: The original production dependency that stalled remains unknown. Standalone Workerd does not reproduce the hosted platform's 30-second post-response cancellation limit. The old durable body's stale classification is a complementary call to the canonical freshness function; the actual subsequent HTTP response selected the newer fresh snapshot. The cache has no cross-isolate monotonic ordering guarantee. This fixture does not certify full worker inventory or static assets; the Bay image placeholder is a fixture limitation.

@clawsweeper

clawsweeper Bot commented Sep 16, 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 P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 12:21 AM ET / 04:21 UTC (Revision 3).

ClawSweeper review

What this changes

Bounds dashboard status collection to 18 seconds, separates snapshot publication from refresh completion, and displays unavailable freshness without an invented age.

Merge readiness

✅ Ready for maintainer review

This fix remains useful: current main can leave status reads and shared refreshes pending indefinitely. No blocking defect was found in the introduced changes, and the recorded runtime proof supports recovery on subsequent polls.

Priority: P2
Reviewed head: 345f68e1bc89b725a2b30a835e4a2256edb0f851

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with strong production-path proof, meaningful regression coverage, and no actionable correctness finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured runtime output and inspected harness exercise the actual status Worker over HTTP with SQLite storage and served Dashboard/Bay clients: stalled reads terminate, timeout results are not persisted, later writes proceed, and normal polling recovers. The proof records binding to the integrated bytes and explicitly limits hosted-runtime claims.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured runtime output and inspected harness exercise the actual status Worker over HTTP with SQLite storage and served Dashboard/Bay clients: stalled reads terminate, timeout results are not persisted, later writes proceed, and normal polling recovers. The proof records binding to the integrated bytes and explicitly limits hosted-runtime claims.
Evidence reviewed 8 items Current main still needs the lifetime bound: At the pinned main revision, statusJson directly awaits cache reads, refreshStatus retains its shared promise until completion, and refreshStatusCaches awaits final persistence without an overall collection deadline.
Introduced lifetime and publication boundaries: The complete Worker diff adds scoped cancellation, bounded reads and body consumption, refresh cleanup retained through waitUntil, and independent best-effort publication of usable snapshots. Shared GitHub token acquisition retains its existing ownership.
Runtime proof tied to the reviewed bytes: The captured PR body, sourceRevision 8172d8b915ac91bb8d0d7ec4c374a8f8751c6c39cdb34bf886a9d65cfedb7e9e, records real loopback HTTP, Workerd, SQLite-backed StatusStore, and Chromium execution against pinned main. Held reads and bodies remained pending for 19,500 ms on baseline and returned in 18,008/18,005 ms after the fix; later polling recovered without reloads. It records zero post-deadline snapshot writes, successful publication while an older write remained held, and candidate-file binding to the reviewed commit. The scratch directory contained no media, so screenshots were not independently viewed; assessment uses the supplied output and inspected harness.
Findings None None.
Security None None.

How this fits together

The dashboard Worker combines cached snapshots, GitHub telemetry, and queue observations into public status responses. Dashboard and OpenClaw Bay poll these responses to display operational health.

flowchart TD
  A[Dashboard and Bay polls] --> B[Status collection deadline]
  B --> C[Read cached snapshot]
  C --> D[Collect GitHub and queue status]
  D --> E[Project public status]
  E --> F[Publish usable snapshot]
  B --> G[Return stale or unavailable status]
  E --> H[Return current status]
  G --> A
  H --> A
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Net code growth Production +158 lines; tests +361; executable proof +530 Production growth implements the collection lifetime boundary, with separate regression and runtime-proof coverage.

Technical review

Best possible solution:

Keep status collection bounded while preserving usable snapshots, truthful freshness, independent authentication, and automatic recovery on ordinary polls.

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

Yes: main directly awaits potentially stalled status reads, and the supplied baseline transcript demonstrates held-read and held-body failures; this review did not execute the fixture.

Is this the best way to solve the issue?

Yes: a collection-owned deadline repairs the shared server path for both clients while retaining existing cache formats, authentication ownership, and polling intervals.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repairs stalled operational status polling without evidence of an urgent core review or delivery outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured runtime output and inspected harness exercise the actual status Worker over HTTP with SQLite storage and served Dashboard/Bay clients: stalled reads terminate, timeout results are not persisted, later writes proceed, and normal polling recovers. The proof records binding to the integrated bytes and explicitly limits hosted-runtime claims.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured runtime output and inspected harness exercise the actual status Worker over HTTP with SQLite storage and served Dashboard/Bay clients: stalled reads terminate, timeout results are not persisted, later writes proceed, and normal polling recovers. The proof records binding to the integrated bytes and explicitly limits hosted-runtime claims.

Evidence

What I checked:

  • Current main still needs the lifetime bound: At the pinned main revision, statusJson directly awaits cache reads, refreshStatus retains its shared promise until completion, and refreshStatusCaches awaits final persistence without an overall collection deadline. (dashboard/worker.ts:1416, ab35b4b52172)
  • Introduced lifetime and publication boundaries: The complete Worker diff adds scoped cancellation, bounded reads and body consumption, refresh cleanup retained through waitUntil, and independent best-effort publication of usable snapshots. Shared GitHub token acquisition retains its existing ownership. (dashboard/worker.ts:655, 345f68e1bc89)
  • Runtime proof tied to the reviewed bytes: The captured PR body, sourceRevision 8172d8b915ac91bb8d0d7ec4c374a8f8751c6c39cdb34bf886a9d65cfedb7e9e, records real loopback HTTP, Workerd, SQLite-backed StatusStore, and Chromium execution against pinned main. Held reads and bodies remained pending for 19,500 ms on baseline and returned in 18,008/18,005 ms after the fix; later polling recovered without reloads. It records zero post-deadline snapshot writes, successful publication while an older write remained held, and candidate-file binding to the reviewed commit. The scratch directory contained no media, so screenshots were not independently viewed; assessment uses the supplied output and inspected harness. (docs/proof/status-publication-outcomes/lifetime-proof.mjs:5, 345f68e1bc89)
  • Compatibility and proof limits: The existing public contract reprojects cached data and preserves timestamp-based freshness. The lifetime recipe explicitly preserves best-effort publication, allows late completed writes to retain their original timestamps, and disclaims cross-isolate ordering and reproduction of the hosted 30-second post-response cutoff. (docs/proof/status-publication-outcomes/README.md:99, 345f68e1bc89)
  • Re-review continuity: The previous review reported no findings. Comparing its head with this head shows no changes to dashboard code, the proof package, or the two affected test files; the updated body supplies fresh proof for the integrated tree. (345f68e1bc89)
  • Related merged work addresses a different problem: improve: bound dashboard status-store reads #1120 merged bounded telemetry-population reads for automerge metrics and apply observability; it does not provide the status collection deadline or polling recovery implemented here.

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-16T09:32:09.602Z sha c97007a :: needs maintainer review before merge. :: none
  • reviewed 2026-09-16T09:44:52.699Z sha c97007a :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review September 16, 2026 09:42
@vincentkoc
vincentkoc merged commit f8ec10f into main Sep 17, 2026
13 checks passed
@vincentkoc
vincentkoc deleted the fix/status-refresh-lifetime-20260916 branch September 17, 2026 04:32
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. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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