Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions services/www/src/docs/content/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ All experimental settings live under the `experimental` key:
"subagent_depth": 2,
"portable_shell_scanner": true,
"location_idle_timeout": "4 hours",
"precompute_compaction": true,
},
}
```
Expand Down Expand Up @@ -660,6 +661,30 @@ value.
}
```

### Background compaction

Set `precompute_compaction` to `true` to write the [compaction](/compaction) summary in the background before automatic
compaction is due, so the session doesn't pause while the summary is generated. Defaults to `false`.

```jsonc
{
"experimental": {
"precompute_compaction": true,
},
}
```

Once the context reaches 85% of the compaction threshold, OpenCode summarizes everything before the latest response
and holds the summary. When compaction is due, including a manual request, it uses that summary and keeps the messages
since it verbatim. If the summary is still being written, compaction waits for it.

| Case | Behavior |
| --- | --- |
| Cost | A background summary costs tokens even if it is never used. None starts until the prompt is at least 64k tokens. |
| Stale summary | Discarded, and the conversation summarized as usual, if the model, instructions, or conversation start changed, or too much was added since it was written. |
| Requires | `compaction.auto` enabled and OpenCode's own summaries. Not used with native provider compaction or when recovering from a request rejected as too long. |
| Restart | Held summaries live in memory and are lost when OpenCode restarts. |

### Deprecated policies

`experimental.policies` is deprecated. Use top-level [`policies`](/policies) instead. The old key still works and
Expand Down
Loading