GeezerVison is showing github.com — [FEATURE]: Enable 1M context window for Anthropic Claude models · Issue #13455 · anomalyco/opencode
[FEATURE]: Enable 1M context window for Anthropic Claude models #13455
Description
Problem
OpenCode currently sets the context window limit for claude-opus-4-6 (and other Claude models) to 200,000 tokens, matching the default Anthropic API limit. However, Anthropic supports a 1,000,000 token context window when the context-1m-2025-08-07 beta header is sent.
The OpenCode console/zen proxy already sends this header (in packages/console/app/src/routes/zen/util/provider/anthropic.ts), but the core opencode package does not — meaning users running OpenCode locally with their own API key are limited to 200K context.
Proposed Solution
-
Add context-1m-2025-08-07 to the anthropic-beta header in the Anthropic provider configuration (packages/opencode/src/provider/provider.ts), so the 1M context API feature is activated for all Anthropic requests.
-
Update the context window limit for models that support 1M context (currently claude-opus-4-6 and Claude Sonnet models) from 200,000 to 1,000,000 in the model data pipeline.
This enables OpenCode to hold much larger codebases in memory during sessions, which is transformative for large-scale refactors and migrations.
References
- Anthropic docs: Extended context window beta
- The console/zen proxy already implements this:
packages/console/app/src/routes/zen/util/provider/anthropic.ts line 37
context_over_200k pricing is already supported in the cost calculation logic
Activity
github-actions commented on Feb 13, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
- The issue title should start with
[FEATURE]: as specified in the Feature Request template. Current title: "feat: Enable 1M context window for Anthropic Claude models" should be "[FEATURE]: Enable 1M context window for Anthropic Claude models"
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
If you believe this was flagged incorrectly, please let a maintainer know.
changed the title
[-]feat: Enable 1M context window for Anthropic Claude models[/-] [+][FEATURE]: Enable 1M context window for Anthropic Claude models[/+] on Feb 13, 2026mguttmann commented on Feb 13, 2026
Closing - the context-1m beta is not available for all Anthropic subscriptions. Sending this header causes errors for users without access to the feature.
Metadata
Metadata
Development
No branches or pull requestsIssue actions