docs: document tool output truncation settings

This commit is contained in:
Aiden Cline 2026-05-22 16:55:00 -05:00
commit 6d3c4c916b

View file

@ -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.