diff --git a/.gitignore b/.gitignore index 29afb5e1261..8c021b0d94a 100644 --- a/.gitignore +++ b/.gitignore @@ -121,3 +121,4 @@ dist/protocol.schema.json # Synthing **/.stfolder/ +openclaw diff --git a/src/gateway/server-methods/chat.ts b/src/gateway/server-methods/chat.ts index 291e323b671..aa035661aa6 100644 --- a/src/gateway/server-methods/chat.ts +++ b/src/gateway/server-methods/chat.ts @@ -352,6 +352,14 @@ function sanitizeUsage(raw: unknown): Record | undefined { } } + // Preserve nested usage.cost when present + if ("cost" in u && u.cost != null && typeof u.cost === "object") { + const sanitizedCost = sanitizeCost(u.cost); + if (sanitizedCost) { + (out as Record).cost = sanitizedCost; + } + } + return Object.keys(out).length > 0 ? out : undefined; } diff --git a/ui/src/ui/chat/slash-command-executor.ts b/ui/src/ui/chat/slash-command-executor.ts index d1c767370a4..2d5366e7087 100644 --- a/ui/src/ui/chat/slash-command-executor.ts +++ b/ui/src/ui/chat/slash-command-executor.ts @@ -354,10 +354,10 @@ function resolveKillTargets( const isMatch = (normalizedTarget === "all" && belongsToCurrentSession) || normalizedKey === normalizedTarget || - (parsed?.agentId ?? "") === normalizedTarget || - normalizedKey.endsWith(`:subagent:${normalizedTarget}`) || - normalizedKey === `subagent:${normalizedTarget}` || - (belongsToCurrentSession && normalizedKey.endsWith(`:subagent:${normalizedTarget}`)); + (belongsToCurrentSession && + ((parsed?.agentId ?? "") === normalizedTarget || + normalizedKey.endsWith(`:subagent:${normalizedTarget}`) || + normalizedKey === `subagent:${normalizedTarget}`)); if (isMatch) { keys.add(key); }