Skip to content

Truncate tool result log output to 10 lines#77

Merged
vm-mishchenko merged 1 commit into
mainfrom
260514-spec-truncate-tool-result-log
May 14, 2026
Merged

Truncate tool result log output to 10 lines#77
vm-mishchenko merged 1 commit into
mainfrom
260514-spec-truncate-tool-result-log

Conversation

@vm-mishchenko
Copy link
Copy Markdown
Owner

Summary

  • Adds _truncate_tool_result helper in src/pipeline/runner.py that caps output at 10 lines and appends ... <N> more lines ... when truncated
  • Calls the helper from the tool_result branch of _format_event only; all other branches are unchanged
  • Reduces noise in live console and step log files caused by long Read file dumps and verbose Bash outputs

Test plan

  • Direct unit tests for _truncate_tool_result: single line, 10-line boundary (no marker), 11-line truncation, 250-line truncation, empty string
  • Integration tests for the [ok] branch of _format_event: 10-line passthrough, 11-line truncation, is_error: true still truncated, list-shaped content truncated
  • Existing test_format_event_ok_full_multiline (3-line input) continues to pass unchanged

Long tool results in the event log were cluttering pipeline output.
Add `_truncate_tool_result` to cap display at 10 lines, appending a
"... N more lines ..." marker for anything longer.
@vm-mishchenko vm-mishchenko marked this pull request as ready for review May 14, 2026 22:14
@vm-mishchenko vm-mishchenko merged commit 6955bd4 into main May 14, 2026
1 check passed
@vm-mishchenko vm-mishchenko deleted the 260514-spec-truncate-tool-result-log branch May 14, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant