litellm/tests/test_litellm/llms/bedrock/chat
Mateo Wang 142d5aa12b
fix(bedrock): honor cache_control ttl on message-level cachePoint blocks (#32551)
Bedrock Converse supports cachePoint ttl (1h GA for Claude 4.5+), and
_get_cache_point_block maps cache_control.ttl -> cachePoint.ttl, but the
model parameter its allow-list gate requires was only threaded through
the system-message path. Every message-level path either called
_get_cache_point_block without model= (8 call sites in
_bedrock_converse_messages_pt / _pt_async) or hardcoded
CachePointBlock(type="default") (tool-result blocks and
_convert_to_bedrock_tool_call_invoke), so a requested 1h ttl silently
degraded to the 5-minute default - exactly on the conversation-tail
breakpoint that long-running agents need to survive tool calls longer
than 5 minutes.

- pass model= at the 8 _get_cache_point_block call sites
- tool-result blocks: capture the cache_control dict (was a boolean)
  and route through _get_cache_point_block so ttl survives
- _convert_to_bedrock_tool_call_invoke: accept optional model and route
  per-tool-call cache_control through _get_cache_point_block

Completes the ttl support added for system messages (#19848, #20326):
message-level cache_control now behaves identically.

Note: message-level cache_control on a content-less assistant message
emits no cachePoint at all today; that pre-existing gap is orthogonal
to ttl and left out of scope (per-tool-call placement covers it).

Co-authored-by: Arash <arashne@glia-ai.com>
2026-07-08 20:54:40 -07:00
..
agentcore chore: litellm oss 170626 (#30637) 2026-06-17 21:11:12 -07:00
invoke_transformations fix(bedrock): map guardrailConfig to InvokeModel guardrail headers (#31985) 2026-07-02 18:58:30 -07:00
test_converse_transformation.py fix(bedrock): honor cache_control ttl on message-level cachePoint blocks (#32551) 2026-07-08 20:54:40 -07:00
test_converse_transformation_nova_2.py feat(bedrock): broaden Nova 2 model detection to support nova-2-pro reasoning 2026-02-16 20:35:00 -08:00
test_invoke_handler.py chore(oss): litellm oss staging 120626 (#30292) 2026-06-12 09:49:25 -07:00
test_mistral_config.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_service_tier.py feat(bedrock): add OpenAI-compatible service_tier parameter translation (#18091) 2026-01-12 17:28:49 +05:30
test_streaming_choice_index.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_writer_palmyra.py [Feat] New model - add bedrock writer models (#17685) 2025-12-08 17:49:06 -08:00