Prompt too long when using Claude Opus 4.6 (Global) Amazon Bedrock #8829

Open
opened 2026-02-16 18:10:57 -05:00 by yindo · 4 comments
Owner

Originally created by @shakedlokits on GitHub (Feb 8, 2026).

Originally assigned to: @fwang on GitHub.

Description

Issue

I've got the error:

undefined: The model returned the following errors: prompt is too long: 210602 tokens > 200000 maximum

When using the model: Claude Opus 4.6 (Global) Amazon Bedrock

Expected behavior

The context window of Claude Opus 4.6 is 1M tokens and not 200K tokens.

Workaround

Changed model to Claude Opus 4.5 (Global) Amazon Bedrock which triggered compaction.

Plugins

No response

OpenCode version

1.1.53

Steps to reproduce

  1. Set the model to Claude Opus 4.6 (Global) Amazon Bedrock
  2. Exceed the 200K token limit

Screenshot and/or share link

Image

Operating System

macOS 26.2

Terminal

Ghostty

Originally created by @shakedlokits on GitHub (Feb 8, 2026). Originally assigned to: @fwang on GitHub. ### Description # Issue I've got the error: ``` undefined: The model returned the following errors: prompt is too long: 210602 tokens > 200000 maximum ``` When using the model: `Claude Opus 4.6 (Global) Amazon Bedrock` # Expected behavior The context window of Claude Opus 4.6 is 1M tokens and not 200K tokens. # Workaround Changed model to `Claude Opus 4.5 (Global) Amazon Bedrock` which triggered compaction. ### Plugins _No response_ ### OpenCode version 1.1.53 ### Steps to reproduce 1. Set the model to `Claude Opus 4.6 (Global) Amazon Bedrock` 2. Exceed the 200K token limit ### Screenshot and/or share link <img width="1173" height="86" alt="Image" src="https://github.com/user-attachments/assets/c2c4be63-4496-42a1-804a-0d6c4574a43f" /> ### Operating System macOS 26.2 ### Terminal Ghostty
yindo added the bugzen labels 2026-02-16 18:10:57 -05:00
Author
Owner

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

This issue appears to be related to existing problems with Claude Opus 4.6 context window configuration. Please check:

  • #12507: Beta header 'context-1m-2025-08-07' not sent for Claude Opus 4.6, causing 200k hard limit — This is the root cause. OpenCode needs to send the proper beta header to unlock the 1M context window.
  • #12452: fix(zen): 1M context window beta not sent for Opus 4.6 and Sonnet 4.5 — A proposed fix for the same issue
  • #12438: Claude Opus 4.6 context window limits still 200k — Another user experiencing the same problem even after manual config updates
  • #12330: Model IDs are wrong for Opus 4.6 on AWS Bedrock — Potential additional issue with Bedrock model ID configuration

The core issue is that the context-1m-2025-08-07 beta header is not being sent for Opus 4.6 models, which prevents the Anthropic API from allowing requests beyond 200k tokens despite the model supporting 1M tokens.

@github-actions[bot] commented on GitHub (Feb 8, 2026): This issue appears to be related to existing problems with Claude Opus 4.6 context window configuration. Please check: - #12507: Beta header 'context-1m-2025-08-07' not sent for Claude Opus 4.6, causing 200k hard limit — This is the root cause. OpenCode needs to send the proper beta header to unlock the 1M context window. - #12452: fix(zen): 1M context window beta not sent for Opus 4.6 and Sonnet 4.5 — A proposed fix for the same issue - #12438: Claude Opus 4.6 context window limits still 200k — Another user experiencing the same problem even after manual config updates - #12330: Model IDs are wrong for Opus 4.6 on AWS Bedrock — Potential additional issue with Bedrock model ID configuration The core issue is that the `context-1m-2025-08-07` beta header is not being sent for Opus 4.6 models, which prevents the Anthropic API from allowing requests beyond 200k tokens despite the model supporting 1M tokens.
Author
Owner

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

I'm also getting this issue on Amazon Bedrock

@Badbird5907 commented on GitHub (Feb 12, 2026): I'm also getting this issue on Amazon Bedrock
Author
Owner

@shakedlokits commented on GitHub (Feb 15, 2026):

It's not fixed as of 1.2.4, currently cannot use Opus 4.6 on my work laptop.

@shakedlokits commented on GitHub (Feb 15, 2026): It's not fixed as of `1.2.4`, currently cannot use Opus 4.6 on my work laptop.
Author
Owner

@smashah commented on GitHub (Feb 15, 2026):

happening on 4.6 via antigravity auth also.

@smashah commented on GitHub (Feb 15, 2026): happening on 4.6 via antigravity auth also.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8829