From 14ee9b3b493224f412034cb841ed16c4bc9a8139 Mon Sep 17 00:00:00 2001 From: Renn F Date: Wed, 15 Jul 2026 16:07:55 +0200 Subject: [PATCH] fix(panel): phantom agent states in dashboard + metrics counters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit by_state.running / a.state 'running'/'stopped' never exist in the orchestrator enum (offline/starting/active/waiting/idle/stopping), so these counters were structurally zero — same class as the agents-page Active bug, remaining two sites. --- panel/src/app/(dashboard)/metrics/page.tsx | 6 +++--- panel/src/hooks/use-dashboard.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panel/src/app/(dashboard)/metrics/page.tsx b/panel/src/app/(dashboard)/metrics/page.tsx index 88323db0..24739f94 100644 --- a/panel/src/app/(dashboard)/metrics/page.tsx +++ b/panel/src/app/(dashboard)/metrics/page.tsx @@ -250,11 +250,11 @@ function PerformanceTabContent() { // Agent counts const runningAgents = - status?.by_state?.running || - agentList.filter((a) => a.state === "running").length; + status?.by_state?.active || + agentList.filter((a) => a.state === "active").length; const idleAgents = status?.by_state?.idle || - agentList.filter((a) => a.state === "idle" || a.state === "stopped").length; + agentList.filter((a) => a.state === "idle" || a.state === "offline").length; const waitingAgents = status?.waiting_count || agentList.filter((a) => a.state === "waiting_long").length; diff --git a/panel/src/hooks/use-dashboard.ts b/panel/src/hooks/use-dashboard.ts index fc773b63..989b476e 100644 --- a/panel/src/hooks/use-dashboard.ts +++ b/panel/src/hooks/use-dashboard.ts @@ -80,7 +80,7 @@ export function useMetrics() { blockers, agents: { total_agents: agentStatus?.total_agents ?? 0, - running: agentStatus?.by_state?.running ?? 0, + running: agentStatus?.by_state?.active ?? 0, idle: agentStatus?.by_state?.idle ?? 0, waiting: agentStatus?.waiting_count ?? 0, errors: 0,