Skip to content

Commit 4288cd6

Browse files
committed
fix(web): drop dead "Agent ran command" status variant
`deriveSidebarAgentCommandStatus` only emits a status when at least one localhost URL is detected, so the only label it ever returns is "Agent local URL detected" — the "Agent ran command" union member and the matching runtime fallbacks were unreachable. - types: narrow `SidebarAgentCommandStatus.label` to the literal that's actually produced. - Sidebar dialog title: collapse the dead `?? "Agent ran command"` fallback; pick the title from `isRunning` only. - ThreadStatusIndicators tooltip: drop the unreachable `!isRunning && !hasLocalUrl` branch.
1 parent 8231c95 commit 4288cd6

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

apps/web/src/components/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ function AgentCommandStatusDialog({
468468
</div>
469469
<div className="min-w-0 flex-1">
470470
<DialogTitle className="font-semibold text-[15px] text-foreground leading-tight tracking-tight">
471-
{isRunning ? "Server running" : (status?.label ?? "Agent ran command")}
471+
{isRunning ? "Server running" : "Agent local URL detected"}
472472
</DialogTitle>
473473
<DialogDescription className="mt-0.5 text-[11.5px] text-muted-foreground leading-snug">
474474
{isRunning

apps/web/src/components/ThreadStatusIndicators.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ export function AgentCommandStatusIcon({
102102
}
103103

104104
const hasLocalUrl = status?.hasLocalUrl === true && Boolean(status.primaryUrl);
105+
// `status` is only set when `deriveSidebarAgentCommandStatus` detected a
106+
// URL, so when `!isRunning` we always have `hasLocalUrl`. The `"Server
107+
// running"` branch covers the live-process case without a detected URL.
105108
const label = isRunning
106109
? hasLocalUrl
107110
? "Server running — local URL detected"
108111
: "Server running"
109-
: hasLocalUrl
110-
? "Agent local URL detected"
111-
: "Agent ran command";
112+
: "Agent local URL detected";
112113

113114
const isEmerald = isRunning || hasLocalUrl;
114115

apps/web/src/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@ export interface ThreadTurnState {
140140
}
141141

142142
export interface SidebarAgentCommandStatus {
143-
readonly label: "Agent local URL detected" | "Agent ran command";
143+
// `deriveSidebarAgentCommandStatus` only emits a status when at least one
144+
// localhost URL was detected, so the label is always this constant. Kept as
145+
// a literal type (not a free string) so callers can branch on it safely.
146+
readonly label: "Agent local URL detected";
144147
readonly createdAt: string;
145148
readonly hasLocalUrl: boolean;
146149
readonly urls: ReadonlyArray<LocalhostUrlCandidate>;

0 commit comments

Comments
 (0)