Split Bedrock Claude Opus 4.6 into 200K + 1M models and set 1M beta flag #9108

Open
opened 2026-02-16 18:11:40 -05:00 by yindo · 3 comments
Owner

Originally created by @AndreKurait on GitHub (Feb 11, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

amazon-bedrock currently treats Claude Opus 4.6 as a single model variant, but the 1M context path on Bedrock requires the experimental context-1m-2025-08-07 beta flag.

Without that flag, requests above the normal 200K window can fail even though the model appears to expose a larger context limit.

Expected behavior

  • Default Opus 4.6 model should represent the stable 200K context path.
  • A separate explicit 1M variant should be available.
  • The 1M variant should automatically send the Bedrock Anthropic beta flag (anthropicBeta: [\"context-1m-2025-08-07\"]).

Why this helps

  • Avoids surprising failures for users on the default model.
  • Makes the experimental 1M path opt-in and explicit.
  • Matches AI SDK Bedrock guidance for extended context.

Proposed direction

During provider model normalization for amazon-bedrock, detect Opus 4.6 entries and:

  1. Keep/create a 200K variant (no 1M beta flag).
  2. Add a 1M Experimental variant with the same Bedrock api.id plus anthropicBeta set to context-1m-2025-08-07.

Happy to open a PR with this behavior.

Originally created by @AndreKurait on GitHub (Feb 11, 2026). Originally assigned to: @thdxr on GitHub. ## Problem `amazon-bedrock` currently treats Claude Opus 4.6 as a single model variant, but the 1M context path on Bedrock requires the experimental `context-1m-2025-08-07` beta flag. Without that flag, requests above the normal 200K window can fail even though the model appears to expose a larger context limit. ## Expected behavior - Default Opus 4.6 model should represent the stable 200K context path. - A separate explicit 1M variant should be available. - The 1M variant should automatically send the Bedrock Anthropic beta flag (`anthropicBeta: [\"context-1m-2025-08-07\"]`). ## Why this helps - Avoids surprising failures for users on the default model. - Makes the experimental 1M path opt-in and explicit. - Matches AI SDK Bedrock guidance for extended context. ## Proposed direction During provider model normalization for `amazon-bedrock`, detect Opus 4.6 entries and: 1. Keep/create a `200K` variant (no 1M beta flag). 2. Add a `1M Experimental` variant with the same Bedrock `api.id` plus `anthropicBeta` set to `context-1m-2025-08-07`. Happy to open a PR with this behavior.
Author
Owner

@AndreKurait commented on GitHub (Feb 11, 2026):

Opened a fix PR for this here: https://github.com/anomalyco/opencode/pull/13200

@AndreKurait commented on GitHub (Feb 11, 2026): Opened a fix PR for this here: https://github.com/anomalyco/opencode/pull/13200
Author
Owner

@github-actions[bot] commented on GitHub (Feb 11, 2026):

This issue might be a duplicate or closely related to existing issues. Please check:

  • #12452: fix(zen): 1M context window beta not sent for Opus 4.6 and Sonnet 4.5
  • #12507: Beta header context-1m-2025-08-07 not sent for Claude Opus 4.6, causing 200k hard limit
  • #12338: 1M tokens for Opus 4.6
  • #11267: [FEATURE]: support anthropic beta 1m token on bedrock

These issues all describe the same root cause: the Bedrock provider not sending the required beta flag for Opus 4.6's 1M context window support. It appears work may already be in progress on some of these issues, so please coordinate with the existing discussions before implementing.

@github-actions[bot] commented on GitHub (Feb 11, 2026): This issue might be a duplicate or closely related to existing issues. Please check: - #12452: fix(zen): 1M context window beta not sent for Opus 4.6 and Sonnet 4.5 - #12507: Beta header `context-1m-2025-08-07` not sent for Claude Opus 4.6, causing 200k hard limit - #12338: 1M tokens for Opus 4.6 - #11267: [FEATURE]: support anthropic beta 1m token on bedrock These issues all describe the same root cause: the Bedrock provider not sending the required beta flag for Opus 4.6's 1M context window support. It appears work may already be in progress on some of these issues, so please coordinate with the existing discussions before implementing.
Author
Owner

@karlkurzer commented on GitHub (Feb 12, 2026):

@AndreKurait I missed your fix

I opened PR #13324 to address this. It's similar to your work, but covers Sonnet 4.5 as well #13200:

@karlkurzer commented on GitHub (Feb 12, 2026): @AndreKurait I missed your fix I opened PR #13324 to address this. It's similar to your work, but covers Sonnet 4.5 as well #13200: - Scope: Now covers both Opus 4.6 and Sonnet 4.5. According to AWS documentation (https://repost.aws/questions/QU636ll_JOQxmoTp9kQblG2Q/how-do-i-enable-the-1m-context-window-for-claude-sonnet-4-5-on-amazon-bedrock), both versions need the same beta flag.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9108