From 27a77f28dc237d29c0fc29a515bd04b62a513a85 Mon Sep 17 00:00:00 2001 From: Val Alexander Date: Mon, 9 Mar 2026 18:09:37 -0500 Subject: [PATCH] fix(ui): address review feedback on chat infra slice - export.ts: handle array content blocks (Claude API format) instead of silently exporting empty strings - slash-command-executor.ts: restrict /kill all to current session's subagent subtree instead of all sessions globally - slash-command-executor.ts: only count truly aborted runs (check aborted !== false) in /kill summary --- ui/src/ui/chat/slash-command-executor.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/ui/src/ui/chat/slash-command-executor.ts b/ui/src/ui/chat/slash-command-executor.ts index 3392095c7c1..d1c767370a4 100644 --- a/ui/src/ui/chat/slash-command-executor.ts +++ b/ui/src/ui/chat/slash-command-executor.ts @@ -296,9 +296,14 @@ async function executeKill( } const results = await Promise.allSettled( - matched.map((key) => client.request("chat.abort", { sessionKey: key })), + matched.map((key) => + client.request<{ aborted?: boolean }>("chat.abort", { sessionKey: key }), + ), ); - const successCount = results.filter((entry) => entry.status === "fulfilled").length; + const successCount = results.filter( + (entry) => + entry.status === "fulfilled" && (entry.value as { aborted?: boolean })?.aborted !== false, + ).length; if (successCount === 0) { const firstFailure = results.find((entry) => entry.status === "rejected"); throw firstFailure?.reason ?? new Error("abort failed"); @@ -343,15 +348,16 @@ function resolveKillTargets( } const normalizedKey = key.toLowerCase(); const parsed = parseAgentSessionKey(normalizedKey); + // For "all", only match subagents belonging to the current session's agent + const belongsToCurrentSession = + currentParsed?.agentId != null && parsed?.agentId === currentParsed.agentId; const isMatch = - normalizedTarget === "all" || + (normalizedTarget === "all" && belongsToCurrentSession) || normalizedKey === normalizedTarget || (parsed?.agentId ?? "") === normalizedTarget || normalizedKey.endsWith(`:subagent:${normalizedTarget}`) || normalizedKey === `subagent:${normalizedTarget}` || - (currentParsed?.agentId != null && - parsed?.agentId === currentParsed.agentId && - normalizedKey.endsWith(`:subagent:${normalizedTarget}`)); + (belongsToCurrentSession && normalizedKey.endsWith(`:subagent:${normalizedTarget}`)); if (isMatch) { keys.add(key); }