From 6d3c4c916ba2c24e4b828466186b703168999716 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Fri, 22 May 2026 16:55:00 -0500 Subject: [PATCH] docs: document tool output truncation settings --- packages/web/src/content/docs/config.mdx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index 3cb9d93748..823fd5b91e 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -353,6 +353,27 @@ You can manage the tools an LLM can use through the `tools` option. --- +### Tool output + +You can control when tool output is truncated using the `tool_output` option. When output exceeds either threshold, OpenCode saves the complete output to disk and returns a truncated preview with the saved file path. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "tool_output": { + "max_lines": 2000, + "max_bytes": 51200 + } +} +``` + +- `max_lines` - Maximum number of lines before output is truncated (default: `2000`). +- `max_bytes` - Maximum size in bytes before output is truncated (default: `51200`). + +These thresholds apply to output handled by OpenCode's shared truncation layer, including MCP and plugin tool output. Individual tools that page or cap their own results can have separate limits. + +--- + ### Models You can configure the providers and models you want to use in your OpenCode config through the `provider`, `model` and `small_model` options.