-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Description
Description
Setting compaction: { "auto": false } prevents proactive compaction (the token threshold check), but compaction still runs when the provider returns a hard context overflow error. The auto: false flag is completely ignored in this path.
The catch block for ContextOverflowError in processor.ts bypasses isOverflow() entirely and schedules compaction unconditionally. Once scheduled, the compaction task marker is written into the session message stream and SessionCompaction.process() runs on every subsequent loop iteration regardless of config.
The practical consequence: when a session hits the context limit, stopping and switching to a model with a higher token limit has no effect. The session remains stuck in the compaction task. The only escape is starting a new session entirely or manually changing the session json and removing the error entirely.
Reverting the last message is not an option as the agent would lose track of file edits already made in the session
Plugins
None
OpenCode version
1.2.24
Steps to reproduce
- Set compaction: { "auto": false } in opencode.json
- Run a session until the provider returns a context overflow error (this triggers the auto compaction task)
(optional) - Stop the session and switch to a model with a higher context limit
- Resume - the session is stuck in the compaction task
Screenshot and/or share link
No response
Operating System
Windows 11 Enterprise
Terminal
Windows Terminal