Skip to content

Commit 743956d

Browse files
authored
test(acp): cover UTF-16-safe tool titles
1 parent f6a5dab commit 743956d

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/acp/event-mapper.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Tests ACP tool-call location extraction limits. */
22
import { describe, expect, it } from "vitest";
3-
import { extractToolCallLocations } from "./event-mapper.js";
3+
import { extractToolCallLocations, formatToolTitle } from "./event-mapper.js";
44

55
describe("extractToolCallLocations", () => {
66
it("enforces the global node visit cap across nested structures", () => {
@@ -18,3 +18,13 @@ describe("extractToolCallLocations", () => {
1818
expect(locations).toEqual([{ path: "/tmp/file-0.txt" }, { path: "/tmp/file-1.txt" }]);
1919
});
2020
});
21+
22+
describe("formatToolTitle", () => {
23+
it("does not split surrogate pairs when truncating argument values", () => {
24+
const title = formatToolTitle("exec", {
25+
command: `${"x".repeat(99)}🚀tail`,
26+
});
27+
28+
expect(title).toBe(`exec: command: ${"x".repeat(99)}...`);
29+
});
30+
});

0 commit comments

Comments
 (0)