How to set up context compression for an anthropic provider when the context reaches about 150k #3666

Open
opened 2026-02-16 17:41:02 -05:00 by yindo · 1 comment
Owner

Originally created by @aaudin90 on GitHub (Dec 19, 2025).

Originally assigned to: @rekram1-node on GitHub.

Question

I added this setting, but it doesn't seem to work. Perhaps you need to use aliases or other model names?

"anthropic": {
      "models": {
        "claude-sonnet-4-5-20250929": {
          "limit": {
            "context": 158000,
            "output": 32000
          }
        },
        "claude-opus-4-5-20251101": {
          "limit": {
            "context": 158000,
            "output": 32000
          }
        }
      }
    }
Originally created by @aaudin90 on GitHub (Dec 19, 2025). Originally assigned to: @rekram1-node on GitHub. ### Question I added this setting, but it doesn't seem to work. Perhaps you need to use aliases or other model names? ``` "anthropic": { "models": { "claude-sonnet-4-5-20250929": { "limit": { "context": 158000, "output": 32000 } }, "claude-opus-4-5-20251101": { "limit": { "context": 158000, "output": 32000 } } } } ```
Author
Owner

@github-actions[bot] commented on GitHub (Dec 19, 2025):

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

  • #4857: Hitting context length limit and asking about automatic compression
  • #3829: How to stop compression of sessions - mentions inability to disable automatic compression

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 19, 2025): This issue might be a duplicate of existing issues. Please check: - #4857: Hitting context length limit and asking about automatic compression - #3829: How to stop compression of sessions - mentions inability to disable automatic compression Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3666