Skip to content

fix(bedrock): default prompt caching on for supported Claude models - #14005

Open
dancvv wants to merge 1 commit into
aaif-goose:mainfrom
dancvv:fix/bedrock-cache-default
Open

dancvv wants to merge 1 commit into
aaif-goose:mainfrom
dancvv:fix/bedrock-cache-default

Conversation

@dancvv

@dancvv dancvv commented Dec 3, 2026

Copy link
Copy Markdown

Fixes #13955

Summary

Leaving BEDROCK_ENABLE_CACHING unset now adds cache checkpoints to Bedrock Converse requests for Claude models with documented support. Model IDs from cross-region profiles and foundation-model ARNs use the same lookup. Unrecognized Claude models remain opt-in, which avoids sending a checkpoint to a model that could reject the request.

An explicit false disables caching. An explicit true keeps the existing Claude opt-in, and the per-request disable_prompt_cache flag still takes precedence. The configuration wizard leaves the setting unset when skipped so it can use the per-model default.

Testing

Ran cargo test -p goose --features aws-providers,rustls-tls --lib bedrock. All 88 tests passed locally without live AWS calls. The new regression test covers the default Bedrock model, a global inference profile, an unknown Claude model, a non-Claude model, explicit configuration and the per-request override. The provider metadata test also checks the configuration wizard default.

Related issues

The maintainer's scope and Ready decision specify enabling the supported models by default while retaining the opt-out.

@dancvv
dancvv requested a review from a team as a code owner December 3, 2026 03:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T03:18:26.718724Z d7d061d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7d061d36e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +169 to +170
"3-5-haiku-20241022-v1:0"
| "3-7-sonnet-20250219-v1:0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add Claude 3.5 Sonnet v2 to the default cache allowlist

When a Bedrock request uses anthropic.claude-3-5-sonnet-20241022-v2:0, the extracted ID is 3-5-sonnet-20241022-v2:0, which this list does not recognize. With BEDROCK_ENABLE_CACHING unset, caching therefore remains disabled for this model even though it supports Bedrock prompt caching, so users must still opt in manually. Add the v2 ID to the default allowlist.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BEDROCK_ENABLE_CACHING defaults to false, despite docs suggesting it's true

1 participant