Repository navigation
fix(dashboard): recover status polling after stalled reads - #1599
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 12:21 AM ET / 04:21 UTC (Revision 3). ClawSweeper reviewWhat this changesBounds 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 Review scores
Verification
How this fits togetherThe 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
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
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
ab35b4b52172e72245efccd2241b81c2c86e01bcwithout 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.mddocuments the source owner, baseline, replay command and limits. Revieweddocs/live-dashboard.mdanddocs/state-storage.md; timestamp-based freshness and best-effort snapshot publication remain the existing contract. The operational changelog entry is included.Evidence
345f68e1bc89b725a2b30a835e4a2256edb0f851; signed integration tree:442eadd65a91bf23d27752c4c6a014222a5c1b09.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.ab35b4b52172e72245efccd2241b81c2c86e01bcfound 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..npmrc,.crabbox.yaml, install layout, Node, Wrangler, Playwright and browser executables. All 1,658 tracked inputs were verified before and after validation.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 samesrc/agent-input-scan.tsblob3a0f67ea3d9453b893378bb50001a327f15a5967at 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:
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
c97007a6baca85817e086b5c3a09166de662a0ecwith 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 in345f68e1bc89b725a2b30a835e4a2256edb0f851and matched. The full tree is442eadd65a91bf23d27752c4c6a014222a5c1b09; this is fresh proof for the integrated bytes, not a reuse of the historical c970 run.Trace/artifacts: The new
lifetime-summary-composed-20260917.jsonand fourlifetime-{dashboard,bay}-{unavailable,recovered}-composed-20260917.pngfiles are retained under.artifacts/status-publication-outcomes/, separately from the historical proof. The preserved receipts include:bea4e8e2f8169df3764c326d9770b97b27f43de557182cabab257749b04c6594.785cdb5393424efe9293f25e464736de13c79da276c898c9a2f1f80dddeaa474.87be34cac1f3a335f9989b3a6795aba2c579e29e5f47f446350ff49e3da76bc5.b8994a46e91f3d47a1af42e358bb18ee114616e9bd88d027882630d8d37f8e75.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.