summaryrefslogtreecommitdiff
path: root/agent/tools
diff options
context:
space:
mode:
Diffstat (limited to 'agent/tools')
-rw-r--r--agent/tools/shell.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/agent/tools/shell.lua b/agent/tools/shell.lua
index 815a8b9..f9be58b 100644
--- a/agent/tools/shell.lua
+++ b/agent/tools/shell.lua
@@ -407,18 +407,21 @@ return {
end
local body = buffer_to_string()
+ -- Strip a single trailing newline so the notice (when appended) is
+ -- separated by exactly one blank line, not two.
+ body = body:gsub("\n$", "")
local parts = { header, "", body }
if overflowed then
if spill_path and not spill_error then
parts[#parts + 1] = string.format(
- "\n[truncated: kept last %d bytes; full %d-byte transcript " ..
+ "[truncated: kept last %d bytes; full %d-byte transcript " ..
"saved to %s. Use `read` with `start_line`/`end_line` " ..
"to inspect specific regions.]",
MAX_BYTES, total_written_to_spill, spill_path
)
else
parts[#parts + 1] = string.format(
- "\n[truncated: kept last %d bytes; could NOT spill to disk: %s]",
+ "[truncated: kept last %d bytes; could NOT spill to disk: %s]",
MAX_BYTES, spill_error or "unknown error"
)
end