docs(agent): annotate stream invariants

This commit is contained in:
Peter Steinberger
2026-01-05 18:10:03 +00:00
parent 86ad703f53
commit cc790f2c84
4 changed files with 13 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ export function splitMediaFromOutput(raw: string): {
mediaUrls?: string[];
mediaUrl?: string; // legacy first item for backward compatibility
} {
// KNOWN: Leading whitespace is semantically meaningful in Markdown (lists, indented fences).
// We only trim the end; token cleanup below handles removing `MEDIA:` lines.
const trimmedRaw = raw.trimEnd();
if (!trimmedRaw.trim()) return { text: "" };