Skip to content

fix(bedrock): only add cachePoint where the model supports it - #22

Merged
davehorton merged 1 commit into
mainfrom
fix/bedrock-cachepoint-model-support
Oct 2, 2026
Merged

davehorton merged 1 commit into
mainfrom
fix/bedrock-cachepoint-model-support

Conversation

@davehorton

Copy link
Copy Markdown
Contributor

Problem

On jambonz.cloud, agent prompts to amazon.nova-lite-v1:0 fail with:

Malformed input request: #/toolConfig/tools/2: extraneous key [cachePoint] is not permitted

feature-server always sets cacheKey on agent prompts, and the Bedrock adapter unconditionally appended a cachePoint to system, toolConfig.tools and the last message. Feature-server then retries without tools, so the call degrades to an LLM that can't use tools.

Fix

Gate cache points by model, per the Bedrock prompt caching docs and the Nova model cards:

Model family system messages tools
anthropic.claude* ✓ ✓ ✓
amazon.nova* ✓ ✓ ✗
anything else ✗ ✗ ✗

Matching is by substring, so cross-region profile IDs (us., global., …) work. An application inference profile ARN (no model name in it) gets no cache points, which is the safe outcome.

Tests

New cases in bedrock.cache-key.test.ts for Nova (plain and us. prefixed), a cross-region Claude profile, and Llama. The Nova and Llama cases fail without the fix. Full suite passes (545).

🤖 Generated with Claude Code

Amazon Nova accepts explicit cache checkpoints in system and messages but
rejects one in toolConfig.tools ('extraneous key [cachePoint] is not
permitted'), failing every tool-enabled prompt with a cacheKey. Gate cache
points per model family: Claude gets system/messages/tools, Nova gets
system/messages, everything else gets none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davehorton
davehorton merged commit 2b56ced into main Oct 2, 2026
5 checks passed
@davehorton
davehorton deleted the fix/bedrock-cachepoint-model-support branch October 2, 2026 16:02
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.

1 participant