mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Revert "fix(ui): address review feedback on chat infra slice"
This reverts commit 8a6cd808a1.
This commit is contained in:
@@ -296,14 +296,9 @@ async function executeKill(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const results = await Promise.allSettled(
|
const results = await Promise.allSettled(
|
||||||
matched.map((key) =>
|
matched.map((key) => client.request("chat.abort", { sessionKey: key })),
|
||||||
client.request<{ aborted?: boolean }>("chat.abort", { sessionKey: key }),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
const successCount = results.filter(
|
const successCount = results.filter((entry) => entry.status === "fulfilled").length;
|
||||||
(entry) =>
|
|
||||||
entry.status === "fulfilled" && (entry.value as { aborted?: boolean })?.aborted !== false,
|
|
||||||
).length;
|
|
||||||
if (successCount === 0) {
|
if (successCount === 0) {
|
||||||
const firstFailure = results.find((entry) => entry.status === "rejected");
|
const firstFailure = results.find((entry) => entry.status === "rejected");
|
||||||
throw firstFailure?.reason ?? new Error("abort failed");
|
throw firstFailure?.reason ?? new Error("abort failed");
|
||||||
@@ -348,16 +343,15 @@ function resolveKillTargets(
|
|||||||
}
|
}
|
||||||
const normalizedKey = key.toLowerCase();
|
const normalizedKey = key.toLowerCase();
|
||||||
const parsed = parseAgentSessionKey(normalizedKey);
|
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 =
|
const isMatch =
|
||||||
(normalizedTarget === "all" && belongsToCurrentSession) ||
|
normalizedTarget === "all" ||
|
||||||
normalizedKey === normalizedTarget ||
|
normalizedKey === normalizedTarget ||
|
||||||
(parsed?.agentId ?? "") === normalizedTarget ||
|
(parsed?.agentId ?? "") === normalizedTarget ||
|
||||||
normalizedKey.endsWith(`:subagent:${normalizedTarget}`) ||
|
normalizedKey.endsWith(`:subagent:${normalizedTarget}`) ||
|
||||||
normalizedKey === `subagent:${normalizedTarget}` ||
|
normalizedKey === `subagent:${normalizedTarget}` ||
|
||||||
(belongsToCurrentSession && normalizedKey.endsWith(`:subagent:${normalizedTarget}`));
|
(currentParsed?.agentId != null &&
|
||||||
|
parsed?.agentId === currentParsed.agentId &&
|
||||||
|
normalizedKey.endsWith(`:subagent:${normalizedTarget}`));
|
||||||
if (isMatch) {
|
if (isMatch) {
|
||||||
keys.add(key);
|
keys.add(key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user