fix: stabilize v2 runtime behavior

This commit is contained in:
Dax Raad 2026-06-26 20:56:36 -04:00
commit 655adbf46e
35 changed files with 742 additions and 425 deletions

View file

@ -4,7 +4,9 @@ export function collapseToolOutput(output: string, maxLines: number, maxChars: n
return { output, overflow: false }
}
const preview = lines.slice(0, maxLines).join("\n")
const visible = lines.slice(0, maxLines)
if (lines.length > maxLines && visible.length > 0) visible[visible.length - 1] += "…"
const preview = visible.join("\n")
if (Array.from(preview).length > maxChars) {
return {
output:
@ -15,5 +17,5 @@ export function collapseToolOutput(output: string, maxLines: number, maxChars: n
}
}
return { output: [...lines.slice(0, maxLines), "…"].join("\n"), overflow: true }
return { output: preview, overflow: true }
}