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
[FEATURE]: Feature Request / Bug: Per-agent compaction control breaks local model workflows #34510
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Feature Request / Bug: Per-agent compaction control breaks local model workflows
OpenCode version: 1.17.11 OS: Windows 11
Problem
Auto-compaction cannot be disabled per-agent. The compaction: { "enabled": false } field in agent config is currently ignored — compaction still triggers globally regardless of agent-level settings.
This creates an infinite loop when using local models (LM Studio / Ollama) as agents:
Local model responds and finishes naturally (finish === "stop")
Auto-compaction triggers
OpenCode injects a synthetic "Continue..." message
Local model responds again
Loop repeats indefinitely
This is especially problematic because local models have small context windows (8K–14K tokens). The global system prompt + instructions already consume most of the available context, leaving almost no room before compaction fires.
Current workaround
Setting compaction: { "auto": false } globally disables auto-compaction for all agents, including cloud agents that benefit from it. This is a regression for cloud workflows.
Expected behavior
compaction: { "enabled": false } in an agent config should prevent auto-compaction from triggering for that specific agent session, consistent with how other per-agent overrides already work (model, tools, steps, temperature, permission).
Local model support is one of OpenCode's key differentiators. Without per-agent compaction control, local models are effectively unusable in multi-turn sessions, which defeats the purpose of having local agent configurations.
Activity
github-actions commentedon Jun 29, 2026
This issue might be a duplicate of existing issues. Please check:
If these existing issues cover your use case, please consider adding your context there instead.
github-actions commentedon Aug 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.