Skip to content

Feature Request: Configurable compaction threshold percentage #16204

Description

@smnuman

Description

It would be great to have a configurable threshold for when auto-compaction triggers, specified as a percentage of context window usage.

Use Case

Instead of compaction only triggering when context is ~100% full, users should be able to set a percentage (e.g., 50-62%) to proactively compact before hitting limits.

Proposed Solution

Add a new config option like:

{
  \"compaction\": {
    \"auto\": true,
    \"threshold\": 0.5,  // 50% of context window
    \"prune\": true,
    \"reserved\": 10000
  }
}

Or alternatively, a percentage string:

{
  \"compaction\": {
    \"threshold\": \"50%\"
  }
}

Current Workaround

Currently users can set a high reserved value to force earlier compaction, but this isn't precise and doesn't achieve the same goal.

Context

  • Model: antigravity-claude-opus-4-6-thinking (200k context)
  • User request: trigger compaction at 50-62% token usage

Thanks for considering this!

Activity

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions