fix: disable prompt caching for non-Anthropic Bedrock models#20866
Closed
pierreeurope wants to merge 1 commit intoopenclaw:mainfrom
Closed
fix: disable prompt caching for non-Anthropic Bedrock models#20866pierreeurope wants to merge 1 commit intoopenclaw:mainfrom
pierreeurope wants to merge 1 commit intoopenclaw:mainfrom
Conversation
Disable prompt caching for non-Anthropic models (Nova, Mistral, etc.) on Bedrock by passing cacheRetention: 'none' to the upstream pi-ai provider. These models reject the cachePoint content block as an extraneous key. Fixes openclaw#20815
This was referenced Feb 20, 2026
Contributor
|
Closing as covered by landed equivalent changes. Implemented and landed:
This preserves Anthropic Bedrock caching paths while preventing Nova/Mistral |
steipete
added a commit
that referenced
this pull request
Feb 23, 2026
iamjulio
pushed a commit
to NeuroGym-Dev/openclaw
that referenced
this pull request
Feb 23, 2026
* upstream/main: (1467 commits) fix(doctor): use gateway health status for memory search key check (openclaw#22327) refactor: harden reset notice + cron delivery target flow refactor(exec): simplify env-prefixed wrapper modifier check fix(skills): support multiline frontmatter fallback without PyYAML fix(skills): make quick_validate work without PyYAML fix(exec): bind env-prefixed shell wrappers to full approval text fix(browser): derive relay auth token from gateway token in Chrome extension Browser relay: accept raw gateway token in extension auth fix(gateway): include platform and reason in node command rejection error CLI: fix gateway restart health ownership for child listener pids (openclaw#24696) docs: detail per-agent prompt caching configuration fix(config): tighten bedrock cache-retention type narrowing feat(agents): add per-agent stream params overrides for cache tuning (openclaw#17470) (thanks @rrenamed) fix(providers): support Bedrock Anthropic cacheRetention defaults/pass-through (openclaw#22303) (thanks @snese) fix(providers): disable Bedrock prompt caching for non-Anthropic models (openclaw#20866) (thanks @pierreeurope) docs(changelog): note /new and /reset auth-label removal (openclaw#24409) fix(reply): omit auth labels in /new and /reset docs(changelog): correct kimi issue references test(tools): fix kimi web_search mock typing feat(media): add moonshot video provider and wiring ... # Conflicts: # ui/src/ui/app-render.ts # ui/src/ui/controllers/agents.ts
carlosrivera
pushed a commit
to myascendai/meshiclaw
that referenced
this pull request
Feb 23, 2026
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
plgs2005
pushed a commit
to plgs2005/openclaw
that referenced
this pull request
Feb 24, 2026
margulans
pushed a commit
to margulans/Neiron-AI-assistant
that referenced
this pull request
Feb 25, 2026
brianleach
pushed a commit
to brianleach/openclaw
that referenced
this pull request
Feb 26, 2026
2 tasks
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 26, 2026
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 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.
When using non-Anthropic models on Bedrock (like Amazon Nova or Mistral), the upstream pi-ai provider injects
cachePointblocks into message content by default. These models don't support the Anthropic-specific cache point extension and reject requests with 'extraneous key [cachePoint] is not permitted'.This passes
cacheRetention: "none"to the pi-ai stream options for non-Anthropic Bedrock models, which prevents cachePoint blocks from being added in the first place. Anthropic models on Bedrock are unaffected and keep their existing caching behavior.Fixes #20815
Greptile Summary
Fixes Bedrock API errors when using non-Anthropic models (Amazon Nova, Mistral) by disabling prompt caching for them. The pi-ai Bedrock provider injects
cachePointblocks by default, but only Claude models support this Anthropic-specific extension.The fix adds a detection function to identify Claude model IDs (matching
anthropic.claudeoranthropic/claude) and wraps the stream function to passcacheRetention: "none"for all other Bedrock models. This prevents the upstream provider from injecting unsupported cache control metadata that would cause API rejection errors.Confidence Score: 5/5
Last reviewed commit: 2302126