mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 01:28:27 +00:00
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:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user