Skip to content

feat(ui): add live CPU/memory/delay sparkline graphs to the system busyness overlay - #127650

Merged
steipete merged 2 commits into
mainfrom
steipete/cpu-memory-graphs-9be606
Aug 21, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/cpu-memory-graphs-9be606

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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

  • The status gateway RPC now includes processMemory (rssBytes, heapUsedBytes, heapTotalBytes) next to the existing eventLoop block — additive JSON field, no protocol change.
  • The overlay's "Event loop / status" section is now three vital tiles — CPU (core ratio, loop utilization sub-stat), Memory (RSS, heap sub-stat), Delay p99 (delay max sub-stat) — each with a gradient area sparkline over a rolling ~3-minute window (90 samples at the existing 2s poll), a live pulse dot, and pointer scrubbing that shows the value at any sample plus its age.
  • A tile tints --danger only when the gateway's own eventLoop.degraded reasons implicate that metric (cpu/event_loop_utilization → CPU tile, event_loop_delay → delay tile); charts are otherwise calm --accent-2, since --accent is red in shipped themes and would read as an alert at idle.
  • Memory auto-ranges its baseline near the observed minimum so a steady RSS still shows its drift; CPU and delay stay zero-based. History resets when the overlay reopens. Uptime moved to a slim footer; the duplicated numeric tile grid is gone.
  • The sparkline component lives in the lazily loaded overlay chunk; the startup JS budget is untouched.

Before (first graph iteration) → after (dark, hover scrub, degraded delay, light):

before
after dark
hover scrub
degraded delay tile
after light

Evidence

  • pnpm check:changed green (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. Gateway status/health server-method tests cover the new processMemory field.
  • pnpm ui:build succeeds; pnpm ui:i18n:baseline run for the new keys.
  • Screenshots captured from the mocked Control UI dev server (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's status payload now carries cpuCoreRatio/processMemory so live polling works there too.
  • Codex autoreview (gpt-5.6-sol, high): clean, "patch is correct (0.99)".

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.
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 21, 2026 21:54
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 21, 2026
@steipete
steipete merged commit 9903e40 into main Aug 21, 2026
306 of 307 checks passed
@steipete
steipete deleted the steipete/cpu-memory-graphs-9be606 branch August 21, 2026 22:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 6:00 PM ET / 22:00 UTC.

ClawSweeper review

What this changes

Adds 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 readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: 75f3d211d04e373af48d04601bd3924365aedd2d

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation and focused coverage are solid, while the visible evidence demonstrates mocked rather than live Gateway-backed behavior.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its mock screenshots remain supplemental rather than live integration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its mock screenshots remain supplemental rather than live integration proof.
Evidence reviewed 6 items Current-main baseline: Current main renders only point-in-time utilization and delay values in the overlay, so it does not already provide the requested CPU/memory history.
Gateway owner boundary: The PR adds the memory snapshot at the status RPC owner after the existing status summary and event-loop snapshot are assembled.
UI data flow: The overlay retains bounded status samples and maps the Gateway values into the three diagnostic tiles.
Findings None None.
Security None None.

Live Verification

Command: pnpm ui:build

Result: PASS (completed)

../dist/control-ui/assets/approvals-DIR0dh7a.js                                       3.24 kB │ gzip:   1.42 kB │ map:    18.69 kB
../dist/control-ui/assets/tool-call-diff-DQwrL9hy.js                                  3.30 kB │ gzip:   1.39 kB │ map:    15.05 kB
../dist/control-ui/assets/cypher-7B-pzmVj.js                                          3.31 kB │ gzip:   1.59 kB │ map:     8.52 kB
../dist/control-ui/assets/tiki-CFRPp0lZ.js                                            3.33 kB │ gzip:   1.35 kB │ map:    12.42 kB
../dist/control-ui/assets/device-placement-DJzn_rnK.js                                3.36 kB │ gzip:   1.49 kB │ map:    11.95 kB
../dist/control-ui/assets/session-row-badges-CnnYIgJh.js                              3.39 kB │ gzip:   1.38 kB │ map:    10.82 kB
../dist/control-ui/assets/src-CoYyaX7y.js                                             3.41 kB │ gzip:   1.40 kB │ map:   403.02 kB
../dist/control-ui/assets/vhdl-BZddcJrO.js                                            3.42 kB │ gzip:   1.59 kB │ map:     9.62 kB
../dist/control-ui/assets/sparql-DyxwoOhd.js                                          3.44 kB │ gzip:   1.68 kB │ map:     9.50 kB
../dist/control-ui/assets/catalog-target-2pLk3h1u.js                                  3.49 kB │ gzip:   1.43 kB │ map:    11.35 kB
../dist/control-ui/assets/update-confirmation.runtime-CLPa4k6E.js                     3.50 kB │ gzip:   1.40 kB │ map:    11.06 kB
../dist/control-ui/assets/grouping-B556b90k.js                                        3.50 kB │ gzip:   1.48 kB │ map:    16.90 kB
../dist/control-ui/assets/dist-nzjtGiB0.js                                            3.51 kB │ gzip:   1.82 kB │ map:     6.97 kB
../dist/control-ui/assets/mscgen-B32__qDo.js                                          3.61 kB │ gzip:   1.07 kB │ map:     9.69 kB
../dist/control-ui/assets/exec-approval-fS9MKpyN.js                                   3.63 kB │ gzip:   1.57 kB │ map:    10.40 kB
../dist/control-ui/assets/data-DdqC_7_L.js                                            3.71 kB │ gzip:   1.46 kB │ map:    13.90 kB
../dist/control-ui/assets/app-sidebar-workboard.runtime-Caza_Uw5.js                   3.73 kB │ gzip:   1.49 kB │ map:    10.48 kB
../dist/control-ui/assets/dashboards-page-ClUmiB6_.js                                 3.77 kB │ gzip:   1.55 kB │ map:     8.90 kB
../dist/control-ui/assets/d-CHTIqqSE.js                                               3.79 kB │ gzip:   1.78 kB │ map:    10.87 kB
../dist/control-ui/assets/vb-r_8gcpmz.js                                              3.79 kB │ gzip:   1.93 kB │ map:    11.63 kB
../dist/control-ui/assets/q-DgUvnPlH.js                                               3.79 kB │ gzip:   1.77 kB │ map:     9.81 kB
../dist/control-ui/assets/swift-Bj43ctJA.js                                           3.89 kB │ gzip:   1.93 kB │ map:    10.80 kB
../dist/control-ui/assets/session-progress-cards-xG9ArIgC.js                          3.92 kB │ gzip:   1.72 kB │ map:    16.23 kB
../dist/control-ui/assets/heartbeat-display-C6mdgvqy.js                               3.93 kB │ gzip:   1.84 kB │ map:    16.66 kB
../dist/control-ui/assets/session-placement-recovery-CGq_xKyr.js                      3.94 kB │ gzip:   1.54 kB │ map:    19.85 kB
../dist/control-ui/assets/fortran-DZ1KI-Ge.js                                         3.97 kB │ gzip:   2.02 kB │ map:     9.72 kB
../dist/control-ui/assets/coffeescript-B7AjrdCL.js                                    3.98 kB │ gzip:   1.78 kB │ map:    13.74 kB
../dist/control-ui/assets/place-browser-CyhpLE9w.js                                   4.05 kB │ gzip:   1.43 kB │ map:     9.84 kB
../dist/control-ui/assets/asn1-B1dG7mN_.js                                            4.06 kB │ gzip:   2.04 kB │ map:    10.99 kB
../dist/control-ui/assets/dylan-Dgw7ONEs.js                                           4.15 kB │ gzip:   1.72 kB │ map:    13.98 kB
../dist/control-ui/assets/asterisk-Diryl_rN.js
… output truncated …

Assertions:

  • PASS expect_output: built in

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - The visible evidence uses mocked data; before landing, an isolated live Gateway and Control UI run should confirm the status payload drives the rendered polling path.
  • Complete next step (P2) - Maintainer landing review should finish exact-head CI and capture the missing isolated live UI proof; no mechanical repair is indicated.
Agent review details

Security

None.

PR surface

Source +360, Tests +115, Docs 0, Other +5. Total +480 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 7 413 53 +360
Tests 3 121 6 +115
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 6 1 +5
Total 12 541 61 +480

Review metrics

Metric Value Why it matters
Production versus test delta production +420/-55, tests +121/-6 The production growth implements a new operator-facing diagnostics surface; the focused test growth covers the bounded-history and rendering behavior.

Stored data model

Persistent data-model change detected: vector/embedding metadata: ui/src/styles/debug.css. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Capture isolated live UI proof (recommended)
    Run the built Control UI against an isolated Gateway and show that new status polls populate the three live tiles before merge.
  2. Accept mock-only visual evidence
    Merge based on the mocked UI screenshots and focused tests while explicitly accepting the missing live integration proof.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a maintainer-requested diagnostic UI enhancement rather than a current user-facing regression.
  • add merge-risk: 🚨 other: The user-visible Gateway-to-Control-UI integration has mock proof but no isolated live-flow evidence yet.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its mock screenshots remain supplemental rather than live integration proof.

Label justifications:

  • P3: This is a maintainer-requested diagnostic UI enhancement rather than a current user-facing regression.
  • merge-risk: 🚨 other: The user-visible Gateway-to-Control-UI integration has mock proof but no isolated live-flow evidence yet.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its mock screenshots remain supplemental rather than live integration proof.

Evidence

What I checked:

Likely related people:

  • xingzhou: Available current-main blame attributes the existing Gateway status handler and System busyness overlay baseline to this contributor. (role: recent area contributor; confidence: medium; commits: ee79b0a49aa3; files: src/gateway/server-methods/health.ts, ui/src/pages/debug/debug-overlay.ts, ui/src/pages/debug/debug-overlay-sections.ts)

Rank-up moves

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

  • Capture a redacted isolated Gateway/Control UI run showing a second poll adds live chart data.
  • Let exact-head required CI complete before landing.

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.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: L 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