From 31a0abc6fd5f44fd829231e6e8c453695c5fb02d Mon Sep 17 00:00:00 2001 From: rekram1-node Date: Thu, 22 Oct 2026 19:43:46 +0000 Subject: [PATCH] docs(www): document experimental.precompute_compaction --- services/www/src/docs/content/config.mdx | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/services/www/src/docs/content/config.mdx b/services/www/src/docs/content/config.mdx index b89d3ea1626c..afc9e9f243e5 100644 --- a/services/www/src/docs/content/config.mdx +++ b/services/www/src/docs/content/config.mdx @@ -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, }, } ``` @@ -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