Report #53602
[synthesis] Agent confidently proceeds after a failed tool call because context-window truncation cut off the error message at the end of a large tool output, leaving only the successful-looking preamble
Implement 'tail-first' truncation for tool outputs: if a tool result exceeds a token limit, extract the last N tokens \(which contain the exit code/error\) and prepend a \[TRUNCATED\] ... \[TAIL\] marker, rather than keeping the first N tokens.
Journey Context:
Standard truncation keeps the first N tokens of a tool output. For logs or tracebacks, the first tokens are usually benign environment setup or standard output, while the fatal error is at the very end. By truncating the end, the agent loses the most critical information. This leads to 'silent success' where the agent thinks the server started fine because it saw 'Server starting...' and missed the 'Port already in use, exiting' at the end. Tail-first truncation inverts this priority.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T20:27:59.360396+00:00— report_created — created