[BUG] 2.1.69 sends advanced-tool-use-2025-11-20 beta flag that Bedrock/LiteLLM rejects (regression from 2.1.68)

Status Fixed / completed
Reported on v2.1.68
Maintainer reply None cached
Activity 12 comments · opened Mar 5, 2026 · closed Mar 9, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

Upgrading from 2.1.68 to 2.1.69 causes an immediate API 400 error when using AWS Bedrock via a LiteLLM gateway proxy:

API Error: 400 {"error":{"message":"{\"message\":\"invalid beta flag\"}. Received Model Group=us.anthropic.claude-opus-4-6-v1\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Version 2.1.69 now sends the advanced-tool-use-2025-11-20 beta flag, which was not sent in 2.1.68. The LiteLLM/Bedrock gateway rejects this flag.

Captured with ANTHROPIC_LOG=debug:

2.1.68 (works):

"anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,effort-2025-11-24,adaptive-thinking-2026-01-28"

2.1.69 (fails):

"anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,advanced-tool-use-2025-11-20,effort-2025-11-24"

The new beta advanced-tool-use-2025-11-20 is the culprit. It is added by the u57() function in 2.1.69 which selects between two tool betas based on provider:

// Decompiled from 2.1.69 binary
function u57() {
    let T = V8(); // provider detection
    if (T === "vertex" || T === "bedrock")
        return "tool-search-tool-2025-10-19";   // Bedrock-safe alternative
    return "advanced-tool-use-2025-11-20";       // firstParty only
}

Since CLAUDE_CODE_USE_BEDROCK is not set (this is a gateway proxy, not direct Bedrock), the provider is detected as firstParty, and the Bedrock-incompatible beta is sent. There is no env var or setting to disable this beta.

CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 has no effect because advanced-tool-use is not gated behind the experimental betas check.

What Should Happen?

Claude Code 2.1.69 should work with Bedrock-backed LiteLLM gateways the same as 2.1.68. Options:

  1. Add advanced-tool-use-2025-11-20 to the Bedrock beta filter set, or
  2. Gate it behind CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, or
  3. Use tool-search-tool-2025-10-19 (the Bedrock-safe alternative) when ANTHROPIC_BASE_URL is not api.anthropic.com, or
  4. Add a CLAUDE_CODE_DISABLE_ADVANCED_TOOL_USE env var (consistent with CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING)

Error Messages/Logs

[log] sending request {
  url: "https://<gateway>/v1/messages?beta=true",
  headers: {
    "anthropic-beta": "claude-code-20250219,interleaved-thinking-2025-05-14,advanced-tool-use-2025-11-20,effort-2025-11-24",
  },
}
[log] post https://<gateway>/v1/messages?beta=true failed with status 400 in 844ms - error; not retryable
[log] response error {
  status: 400,
  headers: {
    "x-litellm-version": "1.81.9",
  },
}
API Error: 400 {"error":{"message":"{\"message\":\"invalid beta flag\"}. Received Model Group=us.anthropic.claude-opus-4-6-v1\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Steps to Reproduce

  1. Configure Claude Code with a Bedrock-backed LiteLLM gateway:

``
ANTHROPIC_BASE_URL=https://<litellm-gateway>
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
``

  1. Run Claude Code 2.1.68 -- works normally
  2. Upgrade to Claude Code 2.1.69
  3. Run any prompt -- immediately fails with "invalid beta flag" 400 error
  4. Setting CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 does not help (only changes which thinking beta is sent, not the tool beta)

No known workaround. The advanced-tool-use-2025-11-20 beta has no disable flag.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.68

Claude Code Version

2.1.69 (Claude Code)

Platform

LiteLLM + AWS Bedrock Commercial

Operating System

macOS and Linux

Terminal/Shell

wezterm

Additional Information

  • Gateway: LiteLLM 1.81.9 proxying to AWS Bedrock Commercial
  • Model: us.anthropic.claude-opus-4-6-v1 but all models are affected
  • CLAUDE_CODE_USE_BEDROCK is not set because auth is via API key through the gateway, not IAM
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 is set but does not affect this beta
  • This is a recurring pattern. Related closed issues: #21676 (prompt-caching-scope regression in 2.1.23), #20031 (DISABLE_BETAS not working for Bedrock proxies)
  • The root cause is that provider detection (V8()) only checks CLAUDE_CODE_USE_BEDROCK env var, not the actual backend. Users routing through LiteLLM/API gateways to Bedrock are treated as firstParty and receive betas that Bedrock does not support.

View original on GitHub ↗

12 Comments

github-actions[bot] · 5 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/22893

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

cjpeterein · 5 months ago

Workaround: Confirmed 2.1.69 works with ENABLE_TOOL_SEARCH=0

cjpeterein · 5 months ago

It seems #22893 was fixed some time after 2.1.30, was working in 2.1.68, and is newly-regressed in 2.1.69.

krosk · 5 months ago

Other "workaround": LiteLLM has documented a long term fix in https://docs.litellm.ai/blog/claude-code-beta-headers-incident.

I updated LiteLLM to v1.81.12 stable and it does not show this behavior (with CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 flag enabled).

ldrmcml · 5 months ago

<img width="470" height="133" alt="Image" src="https://github.com/user-attachments/assets/cf815d31-4061-40d5-970e-b6bbb2fe86df" />

windows10+vscode claude sonnet 4.6

I just set system envirenment ENABLE_TOOL_SEARCH=0, and restart all vscode windows, it just happened again.

Maybe I must to fallback to claude 2.1.63.

hiapk · 5 months ago
Workaround: Confirmed 2.1.69 works with ENABLE_TOOL_SEARCH=0

This setting works for me and solved my problem.

ldrmcml · 5 months ago

I just create a new session, it take effect. Just not use the old session where the problem happened.

saucoide · 5 months ago

This beta-headers and the variable being ignored keeps happening again and again, you'd think there'd be a test after the 4th or 5th regression

dbogey · 5 months ago

Confirming this also affects Portkey proxy → AWS Bedrock users, not just LiteLLM.

Setup: Pitt AI Connect (university FERPA-compliant Bedrock access) via Portkey gateway using ANTHROPIC_BASE_URL=https://api.portkey.ai with virtual keys.

Same symptoms:

  • v2.1.63 → works fine
  • v2.1.69 → immediate 400 {"error":{"message":"bedrock error: invalid beta flag"}}
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 has no effect
  • Overriding anthropic-beta via ANTHROPIC_CUSTOM_HEADERS has no effect (internal header takes precedence)

Workaround: Rolled back to v2.1.63.

The root cause identified in the issue (provider detection via V8() only checking CLAUDE_CODE_USE_BEDROCK, not the actual backend) is spot-on. Any gateway proxy to Bedrock that uses ANTHROPIC_BASE_URL instead of CLAUDE_CODE_USE_BEDROCK will hit this.

ryanotella · 5 months ago

Looks like Claude Code 2.1.70 may resolve this.

cjpeterein · 5 months ago

Confirmed fixed in 2.1.70.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.