Expand description
Tool output truncation with temp file overflow.
When tool output exceeds size limits (lines or bytes), the full output is
saved to a temp file under ~/.opendev/tool-output/ and the agent receives
a truncated preview plus the file path for follow-up reads.
Mirrors OpenCode’s Truncate system.
Structs§
- Truncate
Result - Result of a truncation attempt.
Enums§
- Truncate
Direction - Direction from which to keep lines when truncating.
Constants§
- MAX_
BYTES - Maximum output size in bytes before truncation (50 KB).
- MAX_
LINES - Maximum number of lines before truncation.
Functions§
- cleanup_
old_ files - Clean up overflow files older than the retention period (7 days).
- output_
dir - Get the directory for storing truncated tool output.
- truncate_
output - Truncate tool output if it exceeds size limits.