[PR #11931] feat(compaction): configurable threshold and model (global + per-model) #13992

Open
opened 2026-02-16 18:18:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11931

State: open
Merged: No


Ever noticed how Opus gets kinda dumb around 50-60% context? Yeah, me too. Built this to escape the dumbzone.

Adds compaction settings at both global and per-model levels:

  • threshold (1-100) - trigger compaction earlier, before models go stupid
  • model - use a cheaper model for compaction (why waste Opus on summaries?)

Global config:

{
  "compaction": {
    "threshold": 80,
    "model": "anthropic/claude-haiku-5-20260205"
  }
}

Per-model config:

{
  "provider": {
    "anthropic": {
      "models": {
        "claude-opus-4-20250514": {
          "compaction_threshold": 50,
          "compaction_model": "zhipu/glm-4-plus"
        }
      }
    }
  }
}

Per-model overrides global. Default is 100 (current behavior).

Closes #11930
Relates to #11314, #8140, #10017, #8629

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11931 **State:** open **Merged:** No --- Ever noticed how Opus gets kinda dumb around 50-60% context? Yeah, me too. Built this to escape the dumbzone. Adds compaction settings at both global and per-model levels: - `threshold` (1-100) - trigger compaction earlier, before models go stupid - `model` - use a cheaper model for compaction (why waste Opus on summaries?) **Global config:** ```json { "compaction": { "threshold": 80, "model": "anthropic/claude-haiku-5-20260205" } } ``` **Per-model config:** ```json { "provider": { "anthropic": { "models": { "claude-opus-4-20250514": { "compaction_threshold": 50, "compaction_model": "zhipu/glm-4-plus" } } } } } ``` Per-model overrides global. Default is 100 (current behavior). Closes #11930 Relates to #11314, #8140, #10017, #8629
yindo added the pull-request label 2026-02-16 18:18:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13992