快速结论:当通过 LiteLLM 的 bedrock_invoke 路由发送带 Anthropic tool-search beta 工具(tool_search_tool_regex_20251119)的请求时,LiteLLM 会在本地预检阶段拒绝该工具类型,报错 [Bug]: Bedrock Invoke rejects `tool_search_tool_regex_20251119` server-side tool type (Anthropic tool-search beta)。优先排查并升级 LiteLLM 版本。
适用环境:Issue 中确认的环境为 LiteLLM v1.83.14-stable(在当时的 main 分支也可复现);模型为 claude-haiku-4-5-bedrock-invoke;请求走 LiteLLM 代理(http://127.0.0.1:4000/v1/messages)。未提及具体操作系统、Python、CUDA、显卡信息。
最快修复方案:升级到 LiteLLM v1.98.0 或更高版本。该版本包含 #36502 的修复,移除了遗漏 Haiku 4.5 的硬编码工具类型 allowlist。
注意事项:Issue 中提到 #36502 先合并到 staging 且“尚未发布”,随后才随 v1.98.0 发布;#41702 进一步将修复扩展到 Opus 4.8、Opus 5 和 Sonnet 5。若你使用的模型不在上述范围内,升级后仍可能触发同类 allowlist 限制,建议自行确认。
问题场景
用户在 LiteLLM 代理上调用 /v1/messages 接口,模型名为 claude-haiku-4-5-bedrock-invoke,并通过 bedrock_invoke 路由使用 Anthropic 的 tool-search beta(SDK 版本锁定的工具类型 tool_search_tool_regex_20251119)。LiteLLM 在请求真正发往 Bedrock 之前就做了工具类型校验,导致请求被本地拒绝。同样的 payload 在 Anthropic 原生、Azure、Bedrock Converse 和 Vertex AI 上都能返回 200。
报错原文
Input tag 'tool_search_tool_regex_20251119' found using 'type' does not match any of the
expected tags: 'bash_20241022', 'bash_20250124', 'computer_20241022', 'computer_20250124',
'custom', 'memory_20250818', 'text_editor_20241022', 'text_editor_20250124',
'text_editor_20250429', 'text_editor_20250728', 'web_search_20250305'
原因分析
最可能的原因是 Bedrock Invoke 请求转换器(Bedrock Invoke chat transformer)中的工具类型 allowlist 没有包含 tool_search_tool_regex_20251119。虽然匹配的 anthropic-beta 头(advanced-tool-use-2025-11-20,或在 Bedrock/Vertex 上为 tool-search-tool-2025-10-19)已经被转发,但预检校验仍然使用的是硬编码的白名单,因此请求在到达 Bedrock 之前就被 LiteLLM 拦截。Issue 指出 Bedrock 本身接受该工具,拒绝发生在 LiteLLM 客户端侧。后续确认该 allowlist 遗漏了 Haiku 4.5。
环境排查
- 确认 LiteLLM 版本:
v1.83.14-stable已被确认存在该问题;升级前请先核对当前版本是否低于v1.98.0。 - 确认请求使用的模型名,例如
claude-haiku-4-5-bedrock-invoke;#41702 之后 Opus 4.8、Opus 5 和 Sonnet 5 也被覆盖。 - 确认请求走的是
bedrock_invoke路由,而不是 Bedrock Converse 或其他提供商路由。 - 确认工具定义中
type为tool_search_tool_regex_20251119的情况,以及 SDK 版本裸名tool_search_tool_regex是否被正确识别。 - 确认
anthropic-beta请求头已携带advanced-tool-use-2025-11-20或tool-search-tool-2025-10-19。 - Issue 未提供操作系统、Python、CUDA、显卡等具体信息,这些项目无需在排查中作为判断依据。
解决步骤
- 将 LiteLLM 升级到
v1.98.0或更高版本。该版本包含 #36502 的修复,移除了遗漏 Haiku 4.5 的硬编码 allowlist。 - 如果使用的是 Opus 4.8、Opus 5 或 Sonnet 5,确认所用版本已包含 #41702 的扩展修复。
- 升级后,用 Issue 中的 reproducer 重新发送请求,观察是否仍返回同一条报错。
- 如果升级不可行,可优先尝试改用 Bedrock Converse、Anthropic 原生、Azure 或 Vertex AI 路由绕过该问题,因为 Issue 确认这些路由都能返回 200。
验证方法
用 Issue 中的 curl 请求重新调用 /v1/messages,传入 tool_search_tool_regex_20251119 工具定义。如果请求不再返回上述 Input tag ... does not match any of the expected tags 错误,而是正常进入 Bedrock 执行并返回响应,则说明 allowlist 问题已解决。
参考来源
AI 工具推荐
想把多个 AI 模型放在一个入口?
GamsGo AI 集成 ChatGPT、DeepSeek、Gemini、Claude、Midjourney、Veo 等常用模型,适合写作、绘图、视频和日常 AI 工作流。
推广链接:通过此链接购买,我可能获得佣金,不影响你的价格。
这个方案解决了吗?
可以继续搜索完整报错,或查看同一工具的其他排查指南。
![[Bug]: Prompt Injection Detection Issues](https://www.chat-gpts.plus/wp-content/uploads/2026/09/19499-b454780e-768x403.jpg)
![Misc. bug: [SYCL] incorrect func sig for `ggml_backend_sycl_split_buffer_type`](https://www.chat-gpts.plus/wp-content/uploads/2026/09/28980-ec167301-768x403.jpg)
