fix: format exec elevated flag first in tool summaries

This commit is contained in:
Peter Steinberger committed 2026-01-17 21:54:24 +00:00
1 parent 4b11ebb30e
commit 3200b51160
3 files changed
+47 -2

No files matched your search

+10
View File
@@ -42,6 +42,16 @@ describe("tool meta formatting", () => {
expect(out).toContain("`~/dir/a.txt`");
});
it("keeps exec flags outside markdown and moves them to the front", () => {
vi.stubEnv("HOME", "/Users/test");
const out = formatToolAggregate(
"exec",
["cd /Users/test/dir && gemini 2>&1 · elevated"],
{ markdown: true },
);
expect(out).toBe("🛠️ exec: elevated · `cd ~/dir && gemini 2>&1`");
});
it("formats prefixes with default labels", () => {
vi.stubEnv("HOME", "/Users/test");
expect(formatToolPrefix(undefined, undefined)).toBe("🧩 tool");