Skip to content

feat(opencode): add cache_point_ttl option for Bedrock provider#23108

Open
bainos wants to merge 7 commits intoanomalyco:devfrom
bainos:feat/bedrock-cache-point-type
Open

feat(opencode): add cache_point_ttl option for Bedrock provider#23108
bainos wants to merge 7 commits intoanomalyco:devfrom
bainos:feat/bedrock-cache-point-type

Conversation

@bainos
Copy link
Copy Markdown
Contributor

@bainos bainos commented Apr 17, 2026

Issue for this PR

Closes #23106

Type of change

  • New feature

What does this PR do?

Adds `cache_point_ttl` to Bedrock provider options in `opencode.json` (`5m` or `1h`).
When set, a `cachePoint` block with the configured TTL is injected after the system prompt. Cache token usage is mapped into the existing token tracking.

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "amazon-bedrock": {
      "options": {
        "setCacheKey": true,
        "cache_point_ttl": "1h"
      }
    },
  }
}
                                                                                                                                                                                               ### How did you verify your code works?

Ran sessions against Bedrock Sonnet 4.6 (global inference profile). Confirmed correct TTL value appears in `cacheDetails` of the Converse API response.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@bainos bainos force-pushed the feat/bedrock-cache-point-type branch from 4f22515 to 74523dd Compare April 20, 2026 11:48
@bainos bainos force-pushed the feat/bedrock-cache-point-type branch from e7c8863 to f2558a3 Compare April 23, 2026 12:21
@mohammadidinani
Copy link
Copy Markdown

@bainos any ETA for this?

@bainos bainos force-pushed the feat/bedrock-cache-point-type branch from f2558a3 to 2e086cb Compare April 29, 2026 12:25
@bainos bainos force-pushed the feat/bedrock-cache-point-type branch from 2e086cb to b34b8cc Compare April 30, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Bedrock prompt caching via cache_point_ttl provider option

3 participants