Skip to content

fix(board): show runner container count in NowRail capacity meter#101

Merged
mhersson merged 3 commits into
mainfrom
ctxmax-511/mismatch-in-the-capacity-section-of-the-right-rail
May 18, 2026
Merged

fix(board): show runner container count in NowRail capacity meter#101
mhersson merged 3 commits into
mainfrom
ctxmax-511/mismatch-in-the-capacity-section-of-the-right-rail

Conversation

@contextmatrix-runner
Copy link
Copy Markdown
Contributor

Summary

Fixes the Capacity section of the right rail (NowRail) so it reads running_containers / max_concurrent from /api/runner/health instead of comparing the active-agent count to the runner's container cap. The "Now · agents" section is unchanged and remains the canonical place for agent counts.

Changes

  • web/src/components/Board/NowRail.tsx — new runningContainers?: number prop; Capacity numerator, percentage, head-row "running" text, and meta strip all use runningContainers ?? 0; copy reads "containers" not "agents"; JSDoc updated.
  • web/src/components/Board/Board.tsx — threads runningContainers to NowRail.
  • web/src/components/ProjectShell/ProjectShell.tsx — replaces the one-shot getRunnerHealth() fetch with a 30 s poll (matches dashboard cadence); preserves previous values on transient failure.
  • web/src/components/Board/NowRail.test.tsx — assertions disambiguate container count from agent count and cover the degraded fallback.

Review notes (approve_with_notes)

The reviewer flagged one Important note worth following up in a follow-up PR: the NowRail prop is still named maxAgents while it carries the runner-container cap — consider renaming maxAgents → maxContainers to match the rendered semantics. Several minor optional improvements were also recorded on the card (fake-timers test for the 30 s cadence, zero-case test, gating the poll on remote_execution.enabled).

Test plan

  • npm run lint clean
  • npx tsc -b clean
  • npm test — 591 / 591 pass
  • Manual: open the board on an instance with runner enabled; confirm Capacity reads running_containers / max_concurrent and updates within 30 s after container start/stop.

ContextMatrix Runner and others added 3 commits May 18, 2026 05:47
- replace agents.length with running_containers in the capacity numerator
- poll /api/runner/health every 30s so container count stays current
- thread runningContainers through ProjectShell -> Board -> NowRail
- update NowRail copy to say "containers" not "agents" in Capacity section
- update NowRail tests + JSDoc
- Gate cap meter on both maxAgents and runningContainers; pre-poll falls
  back to "no cap set" instead of flashing 0/N at 0%.
- Drop the runner-cap denominator from the Now·agents head-row (the cap
  is a container-capacity number, not an agent-capacity one).
- Clamp negative/NaN runningContainers so they cannot leak into invalid
  CSS widths.
- Pause polling on hidden tabs, refetch on visibility regain, and abort
  in-flight requests so stale responses cannot overwrite fresh data.
- Log poll failures via console.warn; previous values are preserved on
  transient failures.
- Extract REFRESH_INTERVAL constant to match sibling pollers.
- Add tests for undefined / negative / NaN runningContainers.
…n-the-capacity-section-of-the-right-rail

# Conflicts:
#	web/src/components/Board/Board.tsx
#	web/src/components/ProjectShell/ProjectShell.tsx
@mhersson mhersson force-pushed the ctxmax-511/mismatch-in-the-capacity-section-of-the-right-rail branch 3 times, most recently from eba1681 to 0861d03 Compare May 18, 2026 08:17
@mhersson mhersson merged commit 7cedf21 into main May 18, 2026
14 checks passed
@mhersson mhersson deleted the ctxmax-511/mismatch-in-the-capacity-section-of-the-right-rail branch May 18, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant