litellm/tests/test_litellm/llms/bedrock
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
..
batches test(batches): add 1:1 test file scaffold for batches component paths (#30529) 2026-06-29 09:22:58 +05:30
chat fix(bedrock): honor cache_control ttl on message-level cachePoint blocks (#32551) 2026-07-08 20:54:40 -07:00
count_tokens Litellm oss 090626 (#30021) 2026-06-10 10:34:07 -07:00
embed fix(bedrock/cohere): send embedding_types as JSON array, not string (#28172) 2026-05-18 12:16:20 -07:00
files chore: litellm oss staging (#30745) 2026-06-18 13:55:35 -07:00
image style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
image_edit Litellm ishaan april1 try2 (#25110) 2026-04-03 14:57:44 -07:00
invoke_agent fix: cover provider path traversal variants 2026-04-29 22:29:09 -07:00
messages/invoke_transformations fix(bedrock): emit SSE error event when invoke Messages stream ends without message_stop (#32159) 2026-07-04 17:49:40 -07:00
passthrough feat(proxy): enforce key/team guardrails on bedrock passthrough routes (#30194) 2026-06-12 07:23:29 -07:00
realtime fix(bedrock): honor AWS auth params in realtime handler (#32275) 2026-07-06 16:16:37 -07:00
rerank style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
vector_stores fix: encode upstream URL path identifiers 2026-04-29 22:02:39 -07:00
__init__.py test(batches): add 1:1 test file scaffold for batches component paths (#30529) 2026-06-29 09:22:58 +05:30
test_anthropic_beta_support.py fix(bedrock): allowlist Bedrock Invoke body fields and filter all anthropic-beta values 2026-04-21 11:26:15 -07:00
test_base_aws_llm.py fix(bedrock): stop stale SigV4 headers clobbering fresh signature on strip-and-retry re-sign (#32371) 2026-07-07 16:01:46 -07:00
test_bedrock_common_utils.py fix(bedrock): honor ttl for tool_config cache injection points (#31929) 2026-07-02 16:30:06 -07:00
test_bedrock_ssl_verify.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_claude_platform_provider.py Litellm OSS Staging 010626 (#29422) 2026-06-01 21:42:51 -07:00
test_converse_context_management.py feat(context_management): compact_20260112 polyfill for non-Anthropic providers (#28868) 2026-05-30 09:20:05 -07:00
test_cross_region_inference_profile_mapping.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mantle.py fix(bedrock): preserve stream param and decode SSE for bedrock mantle streaming (#32141) 2026-07-07 10:15:47 -07:00
test_web_identity_session_policy.py fix(bedrock): surface web identity token aud/iss on InvalidIdentityToken (#31412) 2026-06-26 13:03:09 -07:00