feat(web,hub,cli): show machine health in session sidebar#962
Open
heavygee wants to merge 14 commits into
Open
feat(web,hub,cli): show machine health in session sidebar#962heavygee wants to merge 14 commits into
heavygee wants to merge 14 commits into
Conversation
Runners attach OS health snapshots to machine-alive heartbeats; the hub caches them and the web session list renders load or CPU between the machine label and session count. Co-authored-by: Cursor <cursoragent@cursor.com>
Sidebar label now combines CPU and RAM percentages for overload signaling; load stays in the tooltip on Unix. Prime CPU sampling so the first heartbeat includes usage, not just memory. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace bare CPU/RAM text with labeled mini bar gauges, chip border tint by severity, and a HoverTooltip explaining capacity and overload guidance. Co-authored-by: Cursor <cursoragent@cursor.com>
Allow a generous popover width and lay CPU/RAM/load out side by side so the capacity tooltip reads wider and less tall than the chip. Co-authored-by: Cursor <cursoragent@cursor.com>
Wide tooltip was align=end on the chip, so it grew left off-screen. Use row-span positioning on the machine tile button instead. Co-authored-by: Cursor <cursoragent@cursor.com>
Turn the session sidebar machine row into a bordered host panel with OS metadata and side-by-side CPU/RAM meters embedded in the tile instead of a flat label line matching project rows. Co-authored-by: Cursor <cursoragent@cursor.com>
Collapse the machine header back to one py-1.5 row with OS and compact inline health beside the name, and restore the original project indent without the extra nested rail or second header line. Co-authored-by: Cursor <cursoragent@cursor.com>
When the runner reports cpuCount, the tooltip reads "CPU across all 6 cores" instead of the generic all-cores label. Co-authored-by: Cursor <cursoragent@cursor.com>
Dogfood captures for the session sidebar machine tile and capacity tooltip, for upstream PR review. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- [Major] Delayed heartbeat timer survives stop/shutdown — see inline comment at
cli/src/api/apiMachine.ts:502.
Summary
- Review mode: initial
- One lifecycle issue found in the new machine health heartbeat path. It can leave a heartbeat interval running after disconnect/shutdown if the socket stops during the new 50 ms priming delay.
Testing
- Not run (automation). Suggested coverage: fake-timer test that calls
startKeepAlive(), stops/shuts down before 50 ms, advances timers, and asserts nomachine-aliveemit or interval remains.
HAPI Bot
Track the 50ms CPU priming setTimeout and clear it in stopKeepAlive so disconnect/shutdown during the delay cannot leave a stray interval alive. Co-authored-by: Cursor <cursoragent@cursor.com>
Collaborator
Author
|
Addressed the [Major] delayed heartbeat timer finding in
Waiting on CI re-run. |
There was a problem hiding this comment.
Findings
- No findings.
Summary
- Review mode: follow-up after new commits
- No blocking issues found in the latest diff. The prior heartbeat timer leak appears addressed by tracking and clearing
keepAliveStartTimeout. - Residual risk: validation here was static because
bunis unavailable in this runner.
Testing
- Not run (automation;
bunnot found in this environment).
HAPI Bot
Review evidence lives in the PR discussion only; no need to ship PNGs in the repo long-term. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- [Minor] Bound machine metadata width in the sidebar — the new OS/host metadata is rendered as a
shrink-0flex item, so a long hostname or raw platform string can consume more than the sidebar width and push the health chip/session count off-screen. This is introduced in the new machine header row atweb/src/components/MachineGroupHeader.tsx:100.
Suggested fix:<span className="min-w-0 flex-1 truncate text-sm font-semibold text-[var(--app-fg)]"> {props.label} </span> <span className="min-w-0 max-w-[8rem] shrink truncate text-[11px] text-[var(--app-hint)]"> {machineMeta} </span>
Summary
- Review mode: follow-up after new commits
- One minor UI regression risk found in the latest diff. Residual risk: validation here was static because
bunis unavailable in this runner.
Testing
- Not run (automation;
bunnot found in this environment).
HAPI Bot
Bound the metadata span so a long hostname cannot push the health chip or session count off-screen in narrow sidebars. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- [Minor] Make the health tooltip reachable on keyboard focus — the health chip is rendered inside the machine header
<button>, butMachineHealthIndicatoronly relies ongroup-hoverviaHoverTooltip; unlike the existing session-row tooltip usage, it does not pass a parent-focus reveal class. Keyboard users can focus the row but cannot reveal the capacity/status/load tooltip introduced here. Evidence:web/src/components/MachineHealthIndicator.tsx:158.
Suggested fix:// MachineHealthIndicator.tsx export function MachineHealthIndicator(props: { presentation: MachineHealthPresentation className?: string layout?: 'stack' | 'inline' compact?: boolean revealOnParentFocusClass?: string }) { // ... return ( <HoverTooltip id={tooltipId} target={chip} side="bottom" align="row" className="shrink-0" tooltipClassName="px-3 py-2" revealOnParentFocusClass={props.revealOnParentFocusClass} > <MachineHealthTooltipBody presentation={presentation} /> </HoverTooltip> ) } // MachineGroupHeader.tsx <button className={cn('group/machine-row relative flex w-full min-w-0 ...')}> <MachineHealthIndicator presentation={props.healthPresentation!} layout="inline" compact className="shrink-0" revealOnParentFocusClass="group-focus-visible/machine-row:opacity-100 group-focus-visible/machine-row:visible" /> </button>
Questions
- None.
Summary
- Review mode: follow-up after new commits
- One minor accessibility regression found in the latest diff. The previous metadata-width finding appears addressed by the follow-up commit. Residual risk: static review only; local automation could not run because
bunis not installed in this runner.
Testing
- Not run (automation;
bunnot found in this environment).
HAPI Bot
Wire MACHINE_ROW_TOOLTIP_FOCUS_CLASS and aria-describedby on the machine header button so keyboard users can read the health tooltip like session rows. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- No issues found.
Questions
- None.
Summary
- Review mode: follow-up after new commits
- No blocker/major/minor findings in the full current diff. The previous keyboard-focus tooltip finding appears addressed in the follow-up commit. Residual risk: static review only; I did not rerun the full Bun test suite in this review pass.
Testing
- Not run (automation)
HAPI Bot
Bun's os.freemem() reflects MemFree (~1% on cache-heavy hosts), which made sidebar RAM read ~99% while btop showed ~40% used. Parse /proc/meminfo MemAvailable instead so used percent matches operator tools. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Findings
- No issues found.
Questions
- None.
Summary
- Review mode: follow-up after new commits
- No blocker/major/minor findings in the full current diff. I rechecked the CLI heartbeat health sampling, hub validation/broadcast path, SSE machine cache updates, and sidebar presentation wiring. Residual risk: static review only; I did not rerun the full Bun test suite in this review pass.
Testing
- Not run (automation)
HAPI Bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cpuPercent,memoryPercent,load1mon Unix,cpuCount) and attach optionalhealthto existingmachine-alivekeepalives (~20s).cpuCountis known.Test plan
bun typecheckbun run test— 1121/1122 pass; one pre-existing CLI runner integration version-mismatch test flakes unrelated to this diff:3006) with Linux + Windows runners reporting healthFixes #961