Repository navigation
feat(ui): add live CPU/memory/delay sparkline graphs to the system busyness overlay - #127650
Conversation
Merge the duplicated sparkline row and numeric tile grid into three vital tiles (CPU, memory, event-loop delay) with gradient area charts, a live pulse dot, pointer scrubbing with value+age readout, and a danger tint driven by the gateway's own event-loop degradation reasons. Memory auto-ranges its baseline so RSS trends stay visible.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Merged via squash.
|
|
Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 6:00 PM ET / 22:00 UTC. ClawSweeper reviewWhat this changesAdds rolling CPU, process-memory, and event-loop-delay sparklines to the Control UI System busyness overlay, fed by an additive Gateway status response field. Merge readinessKeep open: this maintainer-requested diagnostic feature has a coherent Gateway-to-Control-UI boundary and no actionable patch defect found; capture isolated live UI proof before landing. Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Gateway collects event-loop health and current process memory, then exposes them through its status response. The Control UI polls that response and turns successive snapshots into operator-facing diagnostic trends. flowchart LR
A[Gateway health sampler] --> C[Gateway status response]
B[Process memory snapshot] --> C
C --> D[Control UI polling]
D --> E[Rolling diagnostic history]
E --> F[CPU memory and delay tiles]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +360, Tests +115, Docs 0, Other +5. Total +480 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the compact reuse of existing Gateway health sampling, then land after isolated live UI proof confirms the real status response populates the rolling tiles. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new diagnostics capability rather than repairing a reported failure; focused tests exercise its polling and rendering behavior. Is this the best way to solve the issue? Yes, subject to live integration proof: extending the existing status snapshot and retaining history in the already-polling overlay avoids a second sampling system. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 75b736c25263. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…syness overlay (openclaw#127650) * feat(ui): add cpu/memory graphs to system busyness overlay * refactor(ui): redesign busyness overlay vitals as sparkline stat tiles Merge the duplicated sparkline row and numeric tile grid into three vital tiles (CPU, memory, event-loop delay) with gradient area charts, a live pulse dot, pointer scrubbing with value+age readout, and a danger tint driven by the gateway's own event-loop degradation reasons. Memory auto-ranges its baseline so RSS trends stay visible.
What Problem This Solves
The System busyness overlay (Live diagnostics) only showed point-in-time numbers for event-loop health, and nothing at all about CPU or memory. When an operator opens the overlay to answer "is the gateway struggling right now, and was it struggling a minute ago?", there was no trend information: no CPU history, no RSS/heap visibility, and the numeric tiles reset every 2s poll.
Why This Change Was Made
Requested by the maintainer ("i want graphs, cpu and mem and stuff"). The gateway already samples event-loop delay, utilization, and CPU pressure for readiness (
src/gateway/server/event-loop-health.ts); this surfaces that data plus a cheap process-memory snapshot as live sparkline graphs instead of adding any new sampling machinery.User Impact
statusgateway RPC now includesprocessMemory(rssBytes,heapUsedBytes,heapTotalBytes) next to the existingeventLoopblock — additive JSON field, no protocol change.--dangeronly when the gateway's owneventLoop.degradedreasons implicate that metric (cpu/event_loop_utilization→ CPU tile,event_loop_delay→ delay tile); charts are otherwise calm--accent-2, since--accentis red in shipped themes and would read as an alert at idle.Before (first graph iteration) → after (dark, hover scrub, degraded delay, light):
Evidence
pnpm check:changedgreen (typecheck, lint, stylelint, i18n verify, dead-export, assertion ratchet).pnpm test ui/src/pages/debug— 9,769 tests passed; the overlay test covers history bounding at 90 samples, unclamped CPU >100%, per-tile value/sub-stat rendering, no degraded tint on a healthy loop, chart absence with <2 samples, and history reset on reopen. Gatewaystatus/healthserver-method tests cover the newprocessMemoryfield.pnpm ui:buildsucceeds;pnpm ui:i18n:baselinerun for the new keys.pnpm dev:ui:mock) driven by Playwright in both color schemes; chart history injected client-side to show populated/degraded/hover states (mock data only, nothing sensitive). The mock scenario'sstatuspayload now carriescpuCoreRatio/processMemoryso live polling works there too.