GeezerVison is showing github.com — feat: enable 1M context window for Anthropic Claude models by mguttmann · Pull Request #13457 · anomalyco/opencode
Conversation
mguttmann
commented
Feb 13, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
- Add optional
1m variant for Claude Opus 4.6 that enables the 1M token context window
- Users can select this variant in the model selector (e.g.,
claude-opus-4-6[1m]) to opt-in to extended context
- Default context remains at 200K to avoid higher session costs
Details
This PR makes the 1M context window opt-in rather than automatic. The context-1m-2025-08-07 header is sent to enable the feature on Anthropic's side, but the actual context limit is only increased when the user explicitly selects the [1m] variant.
Why optional?
The 1M context window uses higher token pricing (context_over_200k tier) and delays compaction. Making it opt-in lets users choose when they need the extended context vs. when they prefer lower costs with automatic compaction at 200K.
Changes
- transform.ts: Add
1m variant for Opus 4.6 with contextLimit: 1_000_000
- transform.ts: Add
contextLimit() helper to resolve effective limit from variant
- compaction.ts: Update
isOverflow() to use variant-aware context limit
- processor.ts / prompt.ts: Pass variant to overflow checks
Usage
# Default (200K context, lower cost)
/model anthropic/claude-opus-4-6
# Extended context (1M, higher cost)
/model anthropic/claude-opus-4-6[1m]
Note to reviewers: This supersedes the approach in #12342 which enabled 1M by default. The optional variant approach gives users control over the cost/context tradeoff.
Closes #13455
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The following comment was made by an LLM, it may be inaccurate:
Based on my search, I found one potentially related PR:
Related PR:
The current PR (#13457) is a more comprehensive approach that enables 1M context support for all Anthropic Claude models with the context_over_200k pricing tier, whereas #12342 was focused on adding this support for Claude Opus 4.6 specifically. Depending on the status of #12342, it may have already been merged or superseded by this broader implementation.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add a '1m' variant for Opus 4.6 models that enables the 1M token context
window. Users can select this variant in the model selector to use the
extended context (e.g., claude-opus-4-6[1m]).
Changes:
- Add '1m' variant with contextLimit: 1_000_000 for Opus 4.6 models
- Add contextLimit() helper to resolve effective context limit from variant
- Update isOverflow() to consider variant-based context limits
- Keep anthropic-beta header with context-1m flag (enables the feature)
- Default context remains at 200K to avoid higher costs unless explicitly chosen
Closes #13455
|
@github-actions Thanks for finding the related PR!
Regarding #12342 (feat: add adaptive thinking and 1M context support for Claude Opus 4.6):
This PR takes a different approach by making 1M context opt-in via a variant rather than enabling it by default. Here's why:
Key differences from #12342:
| Aspect |
#12342 |
This PR |
| 1M context |
Always enabled |
Opt-in via [1m] variant |
| Default behavior |
1M context, delayed compaction |
200K context, normal compaction |
| User control |
None |
Full control via variant selection |
| Cost impact |
Higher by default |
User chooses when to pay more |
Why opt-in is better:
- Cost control: 1M context uses the
context_over_200k pricing tier which is significantly more expensive
- Session management: With 1M default, compaction triggers much later, leading to longer sessions that can exceed rate limits
- User choice: Some tasks need extended context, others don't — users should decide
The implementation adds a [1m] variant that users can select when they specifically need the extended context window, similar to how thinking effort variants ([high], [max]) work.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Closing - the context-1m beta is not available for all subscriptions, so this would break the experience for most users.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|