feat(cache): add TTL support to CachePoint for prompt caching#1660
Open
kpx-dev wants to merge 5 commits intostrands-agents:mainfrom
Open
feat(cache): add TTL support to CachePoint for prompt caching#1660kpx-dev wants to merge 5 commits intostrands-agents:mainfrom
kpx-dev wants to merge 5 commits intostrands-agents:mainfrom
Conversation
Add optional ttl field to CachePoint TypedDict to support AWS Bedrock's cache TTL configuration. The field accepts "5m" or "1h" values as specified in the Bedrock API. Updated BedrockModel to preserve ttl field when formatting cache point content blocks. Includes tests for TTL preservation and backward compatibility. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
mkmeral
previously approved these changes
Feb 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
zastrowm
previously approved these changes
Feb 17, 2026
auto-merge was automatically disabled
February 17, 2026 18:09
Head branch was pushed to by a user without write access
Author
|
FYI this PR fails label size: https://github.com/strands-agents/sdk-python/actions/runs/22110060966 . Not sure if CI needs update or label input needs update |
mkmeral
reviewed
Feb 18, 2026
zastrowm
previously approved these changes
Feb 18, 2026
Member
zastrowm
left a comment
There was a problem hiding this comment.
One last nit (imports) - looks good
mkmeral
previously approved these changes
Feb 18, 2026
Contributor
mkmeral
left a comment
There was a problem hiding this comment.
I'll approve. I want to try following up with strands command for nits, let's see how that works. the only nit is the import in the test
zastrowm
approved these changes
Feb 19, 2026
mkmeral
requested changes
Feb 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add optional ttl field to CachePoint TypedDict to support AWS Bedrock's cache TTL configuration. The field accepts "5m" or "1h" values as specified in the Bedrock API. Updated BedrockModel to preserve ttl field when formatting cache point content blocks. Includes tests for TTL preservation and backward compatibility.
Doc shows API supports ttl option now:
https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_CachePointBlock.html
launch announcement:
https://aws.amazon.com/about-aws/whats-new/2026/01/amazon-bedrock-one-hour-duration-prompt-caching/
more details:
https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
Related Issues
#1243
Documentation PR
Type of Change
New feature
Testing
How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli
hatch run prepareChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.