Skip to content

[Bug]: Native Claude beta allowlist drops current Claude Code betas and the context_management body field #7042

Closed

Description

@flokosti96

Client or integration

Claude Code

Area

Provider adapter

Summary

Even for a recognized native Claude Code client on a first-party route, allowlistAnthropicBetas (src/adapters/anthropic/beta-allowlist.ts:42) only forwards a fixed list. Several betas current Claude Code sends are dropped silently, and the matching body field context_management is not in ANTHROPIC_MESSAGES_PASSTHROUGH_FIELDS (src/adapters/anthropic/passthrough.ts:40), so Claude Code's server-side context management never reaches the API.

Reproduction

Captured from Claude Code 2.1.296 (interactive CLI, native Anthropic route through an ocx hub):

anthropic-beta sent:
  claude-code-20250219, interleaved-thinking-2025-05-14, thinking-token-count-2026-05-13,
  context-management-2025-06-27, prompt-caching-scope-2026-01-05,
  mid-conversation-system-2026-04-07, per-turn-control-2026-07-01,
  mid-conversation-tool-changes-2026-07-01, inline-tools-2026-09-15,
  advisor-tool-2026-03-01, advanced-tool-use-2025-11-20, effort-2025-11-24
body keys sent:
  context_management, max_tokens, messages, metadata, model, output_config,
  stream, system, thinking, tools

Dropped by 2.84.0 (offline, providerClass="first-party", observedNativeClient=true):
thinking-token-count-2026-05-13, context-management-2025-06-27, mid-conversation-tool-changes-2026-07-01, advanced-tool-use-2025-11-20, effort-2025-11-24 (plus extended-cache-ttl, context-1m, tool-search-tool when present). The context_management body field is removed by the passthrough field allowlist. The log only says anthropic-beta-dropped without naming values.

Version

@bitkyc08/opencodex 2.84.0, Claude Code 2.1.296

Operating system

macOS 27; the filter is platform independent.

Provider and model

anthropic (OAuth pool), claude-fable-5-1 / claude-opus-5-5 / claude-haiku-5-5

Logs or error output

anthropic-beta-dropped

No 400s: the requests succeed, the features are silently disabled.

Redacted configuration

Hub mode, Claude Code via ocx claude, ENABLE_TOOL_SEARCH=true.

Proposed fix

For recognized native clients on first-party routes, forward header/body capability pairs coherently (at least context-management-2025-06-27 together with context_management), keeping proxy-owned OAuth/tier betas authoritative and never extending this to translated or third-party routes. Naming the dropped values in the log line (anthropic-beta-dropped=<list>) would make the next drift visible. The Claude Code gateway guide warns against pinning individual beta values: https://code.claude.com/docs/en/llm-gateway-protocol

Related: #6895 (per-message effort, different code path).

Screenshots and supporting files

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bugSomething isn't working
    providerProvider adapters, OpenAI-compat presets, upstream API quirks
    on Oct 13, 2026
  2. lidge-jun commented on Oct 13, 2026

    @lidge-jun
    Owner

    Fixed on dev by #7067 (1ff4f7c). A recognized native Claude Code client on a first-party route now forwards context-management-2025-06-27 together with context_management; OAuth also rewrites exclude_tools to the prefixed tool names. Dropped betas are logged once per distinct set as anthropic-beta-dropped=<names>. Only known Anthropic beta names are named; anything else is counted. The other betas from the report stay dropped for now and will show up in that log line.

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

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirks

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions