fix(agent): align tools + preserve indentation

This commit is contained in:
Peter Steinberger
2026-01-05 17:55:20 +00:00
parent 196eb86e38
commit 7c89ce93b5
12 changed files with 88 additions and 46 deletions

View File

@@ -27,8 +27,8 @@ export function splitMediaFromOutput(raw: string): {
mediaUrls?: string[];
mediaUrl?: string; // legacy first item for backward compatibility
} {
const trimmedRaw = raw.trim();
if (!trimmedRaw) return { text: "" };
const trimmedRaw = raw.trimEnd();
if (!trimmedRaw.trim()) return { text: "" };
const media: string[] = [];
let foundMediaToken = false;