You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Compaction ignores "auto: false" config and OPENCODE_DISABLE_AUTOCOMPACT env vars #32385
In version 1.17.7, OpenCode is automatically triggering context compaction even when it is explicitly disabled via both the configuration file and environment variables.
I am managing my context externally using a DCP setup, so I need compaction entirely disabled. Currently, the compaction cycle fires unpredictably, taking over the session despite all configuration flags explicitly telling it not to.
Regardless of how the internal token math evaluates the current context limits, the strict disable flags are being bypassed entirely.
Steps to Reproduce:
Set the following environment variables (e.g., in ~/.bashrc):
Configure your OpenCode settings with the following block:
"compaction": {
"auto": false,
"prune": false
}
Run a session using a model with a large context window.
Observe that OpenCode eventually ignores these overrides and triggers the "Compacting" process anyway.
Expected Behavior:
When auto: false is set in the configuration OR OPENCODE_DISABLE_AUTOCOMPACT=true is present in the environment, the automatic compaction sequence must never be triggered under any circumstances. It should defer to the external context manager, pass the raw context to the provider, or throw a standard overflow error if actually full.
Actual Behavior:
The CLI ignores the boolean off-switches and environment variables, triggering compaction automatically.
Plugins
No response
OpenCode version
1.17.7
Steps to reproduce
No response
Screenshot and/or share link
The context window of GPT 5.5 is though 1.05M however, even if it's overridden (to fix the correct one over the cache) it treats the incorrect 400k as the target calculation, not the opencode.json override one.
If the fix from #30749 did not fully resolve the issue or regressed, it may be worth referencing those issues and noting the version where it reappeared.
Activity
github-actions commentedon Jun 15, 2026
This issue might be a duplicate of existing issues. Please check:
compaction.auto: falseis ignored when the provider throws a context overflow error. This was reportedly fixed by PR fix(opencode): respect disabled auto compaction on overflow #30749 but you may be reporting a regression in 1.17.7.If the fix from #30749 did not fully resolve the issue or regressed, it may be worth referencing those issues and noting the version where it reappeared.
TonyReg commentedon Jun 23, 2026
Latest dev (3cdd431) still has the issue, even after the refactor(core): drop legacy compaction event (#33404)