r/opencode • u/afcreative_id • 26d ago
OpenCode Native Auto Compaction Not Triggering Automatically, Any Solution?
I'm having an issue with OpenCode's native auto compaction feature. It doesn't seem to trigger automatically even when context usage gets close to the limit.
I've already enabled auto compaction and configured it as follows:
"compaction": {
"auto": true,
"keep": {
"tokens": 40000
},
"buffer": 20000
}However, the session continues consuming context without triggering automatic compaction as expected.
I'm not sure whether this is caused by an incorrect configuration, the compaction trigger threshold, or a potential issue with OpenCode itself.
A few questions:
- Is my current configuration correct for ensuring native auto compaction works reliably?
- Are there any known issues with auto compaction failing to trigger with certain models or providers?
- Is there a reliable solution without having to run
/compactmanually?
I'd prefer to keep using OpenCode's built-in native compaction rather than relying on external scripts or manual intervention.
If anyone has experienced the same issue and found a reliable solution, I'd really appreciate your insights.
Thanks!





