From 97e3b60a1c8dc7cb20424901cbd5e6d249da9fca Mon Sep 17 00:00:00 2001 From: OpenCode Date: Sun, 28 Dec 2025 11:38:36 -0500 Subject: [PATCH 1/2] docs: add compaction, watcher, experimental and provider options --- packages/web/src/content/docs/config.mdx | 76 +++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index d7f8031782c..03a2cc83fe3 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -106,7 +106,8 @@ You can configure TUI-specific settings through the `tui` option. "scroll_speed": 3, "scroll_acceleration": { "enabled": true - } + }, + "diff_style": "auto" } } ``` @@ -115,6 +116,7 @@ Available options: - `scroll_acceleration.enabled` - Enable macOS-style scroll acceleration. **Takes precedence over `scroll_speed`.** - `scroll_speed` - Custom scroll speed multiplier (default: `1`, minimum: `1`). Ignored if `scroll_acceleration.enabled` is `true`. +- `diff_style` - Control diff rendering. `"auto"` adapts to terminal width, `"stacked"` always shows single column. [Learn more about using the TUI here](/docs/tui). @@ -178,6 +180,25 @@ You can configure the providers and models you want to use in your OpenCode conf The `small_model` option configures a separate model for lightweight tasks like title generation. By default, OpenCode tries to use a cheaper model if one is available from your provider, otherwise it falls back to your main model. +Provider options can include `timeout` and `setCacheKey`: + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "anthropic": { + "options": { + "timeout": 600000, + "setCacheKey": true + } + } + } +} +``` + +- `timeout` - Request timeout in milliseconds (default: 300000). Set to `false` to disable. +- `setCacheKey` - Enable prompt caching for supported providers. + You can also configure [local models](/docs/models#local). [Learn more](/docs/models). --- @@ -363,6 +384,42 @@ For example, to ensure that the `edit` and `bash` tools require user approval: --- +### Compaction + +You can control context compaction behavior through the `compaction` option. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "compaction": { + "auto": true, + "prune": true + } +} +``` + +- `auto` - Automatically compact the session when context is full (default: `true`). +- `prune` - Remove old tool outputs to save tokens (default: `true`). + +--- + +### Watcher + +You can configure file watcher ignore patterns through the `watcher` option. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "watcher": { + "ignore": ["node_modules/**", "dist/**", ".git/**"] + } +} +``` + +Patterns follow glob syntax. Use this to exclude noisy directories from file watching. + +--- + ### MCP servers You can configure MCP servers you want to use through the `mcp` option. @@ -438,6 +495,23 @@ If a provider appears in both `enabled_providers` and `disabled_providers`, the --- +### Experimental + +The `experimental` key contains options that are under active development. + +```json title="opencode.json" +{ + "$schema": "https://opencode.ai/config.json", + "experimental": {} +} +``` + +:::caution +Experimental options are not stable. They may change or be removed without notice. +::: + +--- + ## Variables You can use variable substitution in your config files to reference environment variables and file contents. From 5ed4be4cae8e64dffebfda8cd1e200c0715e7c1f Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Sun, 28 Dec 2025 23:01:15 -0600 Subject: [PATCH 2/2] Clarify setCacheKey description in config.mdx --- packages/web/src/content/docs/config.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web/src/content/docs/config.mdx b/packages/web/src/content/docs/config.mdx index 03a2cc83fe3..8405297fed3 100644 --- a/packages/web/src/content/docs/config.mdx +++ b/packages/web/src/content/docs/config.mdx @@ -197,7 +197,7 @@ Provider options can include `timeout` and `setCacheKey`: ``` - `timeout` - Request timeout in milliseconds (default: 300000). Set to `false` to disable. -- `setCacheKey` - Enable prompt caching for supported providers. +- `setCacheKey` - Ensure a cache key is always set for designated provider. You can also configure [local models](/docs/models#local). [Learn more](/docs/models).