Skip to content

Feature Request: Configurable compaction threshold percentage #16204

Closed as not planned

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

  1. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature request titles must start with [FEATURE]: (current title uses "Feature Request:" instead)
    • Feature request template requires a verification checkbox confirming the feature doesn't already exist

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 5, 2026
  3. github-actions commented on Mar 5, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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