fix(agents): validate tool-result MEDIA directives with shared parser

Co-authored-by: Ho Lim <166576253+HOYALIM@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-22 19:51:38 +01:00
parent 0c1f491a02
commit c3d11d56c3
4 changed files with 50 additions and 20 deletions

View File

@@ -175,6 +175,18 @@ describe("extractToolResultMediaPaths", () => {
expect(extractToolResultMediaPaths(result)).toEqual([]);
});
it("does not treat malformed MEDIA:-prefixed prose as a file path", () => {
const result = {
content: [
{
type: "text",
text: "MEDIA:-prefixed paths (lenient whitespace) when loading outbound media",
},
],
};
expect(extractToolResultMediaPaths(result)).toEqual([]);
});
it("still extracts MEDIA: at line start after other text lines", () => {
const result = {
content: [