fix: format exec elevated flag first in tool summaries

This commit is contained in:
Peter Steinberger
2026-01-17 21:54:05 +00:00
parent 4b11ebb30e
commit 3200b51160
3 changed files with 47 additions and 2 deletions

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");