Skip to content

[critical] Opus still limited to 200k tokens despite context-1m header #154

Description

@randomm

Description

After adding context-1m-2025-08-07 and adaptive-thinking-2026-01-28 beta headers (PR #152), Opus models still fail at ~200k tokens. The 1M context window is NOT working.

The body.permission: property 'body.permission' is unsupported warning also appears but is cosmetic - not the real problem.

Real Problem

Opus cannot exceed 200k token context despite the 1M header being set.

Possible Causes

  1. Compaction bug (from upstream 1M tokens for Opus 4.6 anomalyco/opencode#12338): Token counting includes output/thinking tokens, triggering compaction too early
  2. Model context limit: Models snapshot may have 200k hardcoded for Opus
  3. Header only works for Sonnet: Upstream originally only applied context-1m for Sonnet models
  4. SDK limitation: @ai-sdk/anthropic@2.0.58 may not support 1M context

Related

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions