From a638f099c8ab39973d1a01fb14422b7b88b762b9 Mon Sep 17 00:00:00 2001 From: Jeremy Ruppel Date: Fri, 8 May 2026 09:37:03 -0400 Subject: [PATCH] fix(site): show running script count instead of log source count in agent log badge (#25079) The badge next to the loading spinner in the agent logs section was showing `agent.log_sources.length` (total log sources registered on the agent). This is a static count unrelated to what's actively running. Now it shows the count of startup scripts still in progress: scripts where `run_on_start` is true and `status` is not yet set. Scripts without a `status` haven't completed; completed scripts receive `"ok"`, `"exit_failure"`, `"timed_out"`, or `"pipes_left_open"`. The badge also hides when zero scripts are running. > [!NOTE] > Generated by Coder Agents --- site/src/modules/resources/AgentRow.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/site/src/modules/resources/AgentRow.tsx b/site/src/modules/resources/AgentRow.tsx index d331a940ff..69739a53e5 100644 --- a/site/src/modules/resources/AgentRow.tsx +++ b/site/src/modules/resources/AgentRow.tsx @@ -150,6 +150,9 @@ export const AgentRow: FC = ({ const showVSCode = hasVSCodeApp && !browser_only; const hasStartupFeatures = Boolean(agent.logs_length); + const runningScriptsCount = agent.scripts.filter( + (s) => s.run_on_start && !s.status, + ).length; const healthIssues = getAgentHealthIssues(agent); const hasAgentIssues = healthIssues.length > 0; const hasWarningIssues = healthIssues.some((i) => i.severity === "warning"); @@ -510,7 +513,7 @@ export const AgentRow: FC = ({ Logs {agent.lifecycle_state === "starting" && - agent.log_sources.length > 0 && + runningScriptsCount > 0 && healthIssues.length === 0 && ( = ({ loading={true} className="text-content-secondary -ml-1" /> - {agent.log_sources.length} + {runningScriptsCount} )} {healthIssues.length > 0 && (