From cb9a97f211c1d0b88c3d45bd78a2b5baf23ca4ac Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 22:29:56 +0100 Subject: [PATCH] test(ui): update home-relative media expectation --- ui/src/ui/chat/message-normalizer.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ui/src/ui/chat/message-normalizer.test.ts b/ui/src/ui/chat/message-normalizer.test.ts index e8a56c31021..d41bbe1a0ba 100644 --- a/ui/src/ui/chat/message-normalizer.test.ts +++ b/ui/src/ui/chat/message-normalizer.test.ts @@ -241,13 +241,23 @@ describe("message-normalizer", () => { ]); }); - it("does not fall back to raw text when an invalid MEDIA line is stripped", () => { + it("keeps home-relative MEDIA paths as assistant attachments", () => { const result = normalizeMessage({ role: "assistant", content: "MEDIA:~/Pictures/My File.png", }); - expect(result.content).toEqual([]); + expect(result.content).toEqual([ + { + type: "attachment", + attachment: { + url: "~/Pictures/My File.png", + kind: "image", + label: "My File.png", + mimeType: "image/png", + }, + }, + ]); }); it("preserves relative MEDIA references as visible text instead of dropping the assistant turn", () => {