fix(agent): preserve oversized tail output with trailing newline

closes #4715
This commit is contained in:
Mario Zechner
2026-05-18 23:05:34 +02:00
parent 93ecdbea35
commit b1893b3d77
3 changed files with 16 additions and 0 deletions

View File

@@ -218,6 +218,7 @@ export function truncateTail(content: string, options: TruncationOptions = {}):
const totalBytes = utf8ByteLength(content);
const lines = content.split("\n");
if (lines.length > 1 && lines[lines.length - 1] === "") lines.pop();
const totalLines = lines.length;
// Check if no truncation needed