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
Performance degradation and long "Thinking" timeouts after multiple context compactions #50103
I've noticed a consistent performance issue during long sessions. After performing around 6–7 consecutive compaction operations, the following symptoms occur:
Stuck in "Thinking" state: The model hangs in the thinking phase indefinitely (in some cases for up to an hour before timing out or disconnecting).
Dropped responses: The model either stops generating output entirely or requires repeating the same prompt multiple times to get a response.
Cumulative degradation: The more compaction cycles the context undergoes within a single session, the worse the stability and response times become.
Additional Context:
This behavior reproduces regardless of the selected model (tested across various LLMs via API / OpenRouter).
The issue is directly tied to the accumulation of history and the number of compaction cycles.
Questions:
Is this a known issue, and could it be related to how context compaction is implemented in OpenCode?
Could this be caused by the compacted context/system prompt becoming too noisy or degraded for the model's attention mechanism as the context window fills up, or is it an issue with sending a massive history payload from the client side?
Are there recommended configuration settings for clearing or limiting system history to prevent this degradation without losing critical session context?
Also related to the infinite thinking thing, I noticed that it could sometimes trigger and infinite compaction loop as well w/o producing results no matter the endpoint being used so this must be a client-side bug / issue to fix because it burns tokens asf repeating the same stuff over and over again w/o getting anywhere at all T_T
Activity
GangstaVik commentedon Sep 20, 2026
+1 I've noticed this as well
Also related to the infinite thinking thing, I noticed that it could sometimes trigger and infinite compaction loop as well w/o producing results no matter the endpoint being used so this must be a client-side bug / issue to fix because it burns tokens asf repeating the same stuff over and over again w/o getting anywhere at all T_T