Dashboard › opencode › OpenCode Truncate service: limits, trun…
019f140c-591b-7518-916f-fb5f756bab04packages/opencode/src/tool/truncate.ts: MAX_LINES=2000, MAX_BYTES=50KB, overridable via cfg.tool_output.max_lines/max_bytes. output() returns unchanged if within limits; otherwise writes full text to file and returns head/tail preview with hint. Hint differs by agent capability: if agent has task tool → delegate to Task tool; else → use Grep/Read with offset/limit. Truncated format: ${preview}\n\n...N lines truncated...\n\n${hint}. Cleanup runs hourly (1-min delay), removes entries older than 7 days. wrap() in tool.ts auto-applies truncation unless result.metadata.truncated is already set.