[BUG] 2.1.69 sends advanced-tool-use-2025-11-20 beta flag that Bedrock/LiteLLM rejects (regression from 2.1.68)
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:
- Add
advanced-tool-use-2025-11-20to the Bedrock beta filter set, or - Gate it behind
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS, or - Use
tool-search-tool-2025-10-19(the Bedrock-safe alternative) whenANTHROPIC_BASE_URLis notapi.anthropic.com, or - Add a
CLAUDE_CODE_DISABLE_ADVANCED_TOOL_USEenv var (consistent withCLAUDE_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
- Configure Claude Code with a Bedrock-backed LiteLLM gateway:
````
ANTHROPIC_BASE_URL=https://<litellm-gateway>
CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
- Run Claude Code 2.1.68 -- works normally
- Upgrade to Claude Code 2.1.69
- Run any prompt -- immediately fails with "invalid beta flag" 400 error
- Setting
CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1does 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-v1but all models are affected CLAUDE_CODE_USE_BEDROCKis not set because auth is via API key through the gateway, not IAMCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1is 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 checksCLAUDE_CODE_USE_BEDROCKenv var, not the actual backend. Users routing through LiteLLM/API gateways to Bedrock are treated asfirstPartyand receive betas that Bedrock does not support.
12 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Workaround: Confirmed 2.1.69 works with ENABLE_TOOL_SEARCH=0
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.
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).
<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.
This setting works for me and solved my problem.
I just create a new session, it take effect. Just not use the old session where the problem happened.
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
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.aiwith virtual keys.Same symptoms:
400 {"error":{"message":"bedrock error: invalid beta flag"}}CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1has no effectanthropic-betaviaANTHROPIC_CUSTOM_HEADERShas 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 checkingCLAUDE_CODE_USE_BEDROCK, not the actual backend) is spot-on. Any gateway proxy to Bedrock that usesANTHROPIC_BASE_URLinstead ofCLAUDE_CODE_USE_BEDROCKwill hit this.Looks like Claude Code 2.1.70 may resolve this.
Confirmed fixed in 2.1.70.
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.