Expand description
Tool output truncation with head+tail sampling.
When tool output exceeds configured limits, the content is truncated using a head+tail sampling strategy: the first half of allowed lines and the last half are preserved, with a truncation marker in between. Full output is written to a file for later inspection.
Ported from OpenCode V2’s ToolOutputStore.bound().
Structs§
- Tool
Output Config - Configuration for tool output truncation.
- Truncation
Result - Result of tool output truncation.
Constants§
- DEFAULT_
MAX_ BYTES - Maximum bytes before truncation applies (default).
- DEFAULT_
MAX_ LINES - Maximum lines before truncation applies (default).
Functions§
- truncate_
output - Applies head+tail sampling truncation to tool output.