Skip to content

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

Closed as not planned

Description

@shakedlokits

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

Activity

  1. github-actions commented on Feb 8, 2026

    @github-actions
    Contributor

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

    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.

  2. Badbird5907 commented on Feb 12, 2026

    @Badbird5907

    I'm also getting this issue on Amazon Bedrock

  3. shakedlokits commented on Feb 15, 2026

    @shakedlokits
    Author

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

  4. smashah commented on Feb 15, 2026

    @smashah

    happening on 4.6 via antigravity auth also.

  5. LucaNerlich commented on Feb 19, 2026

    @LucaNerlich

    Same here. AutoCompaction is either missing or not kicking in. Switching to another model, seems to trigger the compaction, after which one cat switch back to 4.6 etc.

  6. nathanl commented on Mar 6, 2026

    @nathanl

    I accidentally opened a duplicate issue for this. A possible workaround: override the model's limit in ~/.config/opencode/opencode.json:

    {
      "provider": {
        "amazon-bedrock": {
          "models": {
            "us.anthropic.claude-opus-4-6-v1": {
              "limit": {
                "context": 200000,
                "output": 32000
              }
            }
          }
        }
      }
    }

    With this, the "% used" in OpenCode's sidebar appears to be correct for 200K tokens.

  7. removed
    bugSomething isn't working
    zenRelates to Zen
    on May 3, 2026
  8. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions