litellm/tests/integration/messages_endpoint
yucheng-berri 78a6eeb212
fix(anthropic): keep tool names over 64 chars when a guardrail rewrites a /v1/messages request (#47434)
* fix(anthropic): keep tool names over 64 chars when a guardrail rewrites a /v1/messages request

The guardrail translation shortens long tool names for the OpenAI-shaped guardrail input
and wrote the shortened names back into tools and tool_use blocks, while tool_reference
blocks and tool_choice kept the original names, so Bedrock rejected the request

* fix(anthropic): restore declared tool names only from the request's own tool list

A history tool_use name whose shortened form matched a declared short tool renamed that
declared tool, so a forced tool_choice no longer matched and a tool allowlist saw a
different name than the one forwarded

* fix(anthropic): keep a tool_use name the caller already used as written

A history tool_use named exactly like the shortened form of another long name was
rewritten to that long name; such an ambiguous alias is now left alone

---------

Co-authored-by: yucheng-berri <293926326+yucheng-berri@users.noreply.github.com>
2026-10-20 14:13:12 -07:00
..
chat_bridge test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
providers fix(anthropic): keep tool names over 64 chars when a guardrail rewrites a /v1/messages request (#47434) 2026-10-20 14:13:12 -07:00
responses_bridge fix(anthropic): send detail on input_image parts bridged from /v1/messages to Responses (#46720) 2026-10-15 22:33:09 +00:00
safeguards fix(databricks): use the native Anthropic route for Claude /v1/messages (#46091) 2026-10-18 02:44:38 +00:00
test_anthropic_messages_caller_tools_wire.py test(integration): give each owned proxy a private database and Redis by default (#47213) 2026-10-18 03:37:41 +00:00
test_guardrail_long_tool_names_wire.py fix(anthropic): keep tool names over 64 chars when a guardrail rewrites a /v1/messages request (#47434) 2026-10-20 14:13:12 -07:00
test_tool_result_text_wire.py fix(anthropic)!: answer 400 for a malformed tool_result text on /v1/messages and count_tokens (#47347) 2026-10-19 21:13:46 +00:00