Performance degradation and long "Thinking" timeouts after multiple context compactions · Issue #50103 · anomalyco/opencode · GitHub
Skip to content

Performance degradation and long "Thinking" timeouts after multiple context compactions #50103

Open

Description

@PrEvAl85

Description

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?

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. GangstaVik commented on Sep 20, 2026

    @GangstaVik

    +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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions