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]: Per-agent compaction config (disable compaction for specific agents) #16375
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
Compaction is currently only configurable globally via compaction: { auto, prune, reserved }. There is no way to control compaction behavior per-agent.
This causes issues with read-only agents like explore -- when compaction triggers during an explore subagent session, the agent loses its read-only constraints and starts writing code.
Reproduction
Configure the explore subagent with a codex model (e.g. opencode/codex-spark)
Use explore for codebase exploration until context gets long enough to trigger compaction
After compaction, explore starts making file edits despite being a read-only agent
Proposed solution
Allow compaction to be configured per-agent, consistent with how tools, permission, model, steps, and temperature already support per-agent overrides.
---description: Fast codebase explorationmode: subagentcompaction:
auto: false---
Alternative (minimum fix)
If per-agent compaction config is too broad, at minimum the compaction agent should preserve the invoking agent's tool/permission constraints after compacting. If an agent has write: false and edit: false, those constraints should survive compaction.
Why this makes sense
The explore agent is documented as "A fast, read-only agent for exploring codebases. Cannot modify files." (docs). Compaction breaking this contract is unexpected.
Per-agent config already exists for: model, prompt, temperature, top_p, steps, tools, permission, mode, hidden, color, disable. Adding compaction is consistent with this pattern.
Activity
phazei commentedon May 6, 2026
Compaction completely breaks local models that use jinja templates. Disabling it per agent would be ideal.
github-actions commentedon Jul 8, 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.