Update files

This commit is contained in:
Mohamed Boudra
2026-02-07 15:37:44 +07:00
parent 8adcb0a4cd
commit 902a415911
13 changed files with 267 additions and 139 deletions
@@ -111,6 +111,18 @@ describe("parseToolCallDisplay", () => {
expect(display.toolName).toBe("Read");
});
test("normalizes tool names - paseo_voice.speak to Speak", () => {
const input = { text: "hello from namespaced speak" };
const display = parseToolCallDisplay("paseo_voice.speak", input, undefined);
expect(display.toolName).toBe("Speak");
});
test("normalizes tool names - mcp__paseo_voice__speak to Speak", () => {
const input = { text: "hello from claude mcp speak" };
const display = parseToolCallDisplay("mcp__paseo_voice__speak", input, undefined);
expect(display.toolName).toBe("Speak");
});
test("preserves unknown tool names", () => {
const input = { some_arg: "value" };
const display = parseToolCallDisplay("MyCustomTool", input, undefined);
+7 -2
View File
@@ -1,6 +1,9 @@
import stripAnsi from "strip-ansi";
import { z } from "zod";
import { stripShellWrapperPrefix } from "@getpaseo/server/utils/tool-call-parsers";
import {
normalizeToolDisplayName,
stripShellWrapperPrefix,
} from "@getpaseo/server/utils/tool-call-parsers";
import { getNowMs, isPerfLoggingEnabled, perfLog } from "./perf";
const TOOL_CALL_DIFF_LOG_TAG = "[ToolCallDiff]";
@@ -1203,7 +1206,9 @@ const ToolCallDisplaySchema = z
result: z.unknown(),
})
.transform((data) => {
const normalizedToolName = TOOL_NAME_MAP[data.toolName] ?? data.toolName;
const normalizedToolName = normalizeToolDisplayName(
TOOL_NAME_MAP[data.toolName] ?? data.toolName
);
// Handle thinking - input is the thinking text content
if (data.toolName === "thinking") {