fix(coding-agent): aligned output counters after sink replacement

- Adjusted OutputSink to disable head retention after replace(), resetting counters so later pushes append to the tail and do not trigger stale middle-elision in dump().
- Refined artifact link emission to insert a newline separator only when the minimized output lacked one.
- Added a regression test for replace-plus-push ordering that verifies no elision marker and aligned byte counts.
This commit is contained in:
can1357
2026-05-15 11:42:48 +02:00
parent 4679789cf1
commit 2a1052ea9f
3 changed files with 42 additions and 7 deletions
@@ -252,7 +252,8 @@ export async function executeBash(command: string, options?: BashExecutorOptions
outputBytes: minimized.outputBytes,
});
if (artifactId) {
sink.push(`\n[raw output: artifact://${artifactId}]\n`);
const sep = minimized.text.endsWith("\n") ? "" : "\n";
sink.push(`${sep}[raw output: artifact://${artifactId}]\n`);
}
}
}