Steps to Reproduce
There appears to be a public docs/source mismatch for Bedrock prompt caching in the TypeScript SDK.
-
Open this older/still-indexed TypeScript API page:
https://strandsagents.com/latest/documentation/docs/api-reference/typescript/interfaces/BedrockModelOptions.html
It lists cachePrompt?: string and cacheTools?: string on BedrockModelOptions.
-
Compare with the current TypeScript docs:
These show cacheConfig?: CacheConfig, where CacheConfig.strategy is 'auto' | 'anthropic'. The Bedrock guide also says TypeScript tool caching is enabled through cacheConfig, and that there is no separate cacheTools option.
-
Install @strands-agents/sdk@1.0.0 and pass a config object shaped like the older docs suggest. This can happen without a TypeScript error if the object goes through an intermediate variable or as any:
import { BedrockModel } from '@strands-agents/sdk'
const modelConfig = {
region: 'us-east-1',
modelId: 'global.anthropic.claude-sonnet-4-6',
stream: true,
cachePrompt: 'default',
cacheTools: 'default',
}
const model = new BedrockModel(modelConfig as any)
-
Invoke the model through an agent with a system prompt and/or tools, then inspect the actual Bedrock Converse/ConverseStream request body or cache usage metadata.
Expected Behavior
One of these should happen:
- The stale
latest/documentation/docs/api-reference/... page should redirect to the current docs or be updated to show cacheConfig, not cachePrompt / cacheTools.
- Or the SDK should keep backwards-compatible aliases for
cachePrompt / cacheTools and map them to the current cache-point behavior.
- Or the SDK should warn/throw when unsupported cache-looking options are present, so users do not silently believe caching is enabled.
Actual Behavior
cachePrompt and cacheTools are silently ignored by @strands-agents/sdk@1.0.0's Bedrock provider. No cachePoint is emitted from those fields.
From the installed v1.0.0 source:
dist/src/models/bedrock.d.ts: BedrockModelConfig exposes cacheConfig?: CacheConfig; no cachePrompt / cacheTools fields.
dist/src/models/model.d.ts: CacheConfig is { strategy: 'auto' | 'anthropic' }.
dist/src/models/bedrock.js: _shouldEnableCaching() reads only this._config.cacheConfig.
- The Bedrock request formatter adds tool/message
cachePoint only when _shouldEnableCaching() is true.
The upstream source appears to match this:
https://github.com/strands-agents/sdk-typescript/blob/a12ea3e3c4680daacc8ca5937b6b8be41474c92b/strands-ts/src/models/bedrock.ts
Minimal Request-Shape Check
Using the unsupported fields from the stale docs:
const model = new BedrockModel({
region: 'us-east-1',
modelId: 'global.anthropic.claude-sonnet-4-6',
stream: true,
cachePrompt: 'default',
cacheTools: 'default',
} as any)
const request = (model as any)._formatRequest(
[{ role: 'user', content: [{ type: 'textBlock', text: 'hello' }] }],
{ systemPrompt: 'stable system prompt' },
)
console.log(JSON.stringify(request).includes('cachePoint')) // false
Using the current API:
const model = new BedrockModel({
region: 'us-east-1',
modelId: 'global.anthropic.claude-sonnet-4-6',
stream: true,
cacheConfig: { strategy: 'auto' },
})
const request = (model as any)._formatRequest(
[{ role: 'user', content: [{ type: 'textBlock', text: 'hello' }] }],
{ systemPrompt: 'stable system prompt' },
)
console.log(JSON.stringify(request).includes('cachePoint')) // true
Additional Context
AWS Bedrock requires explicit cachePoint checkpoints in the Converse request messages, system, or tools fields for prompt caching:
https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
We hit this in an integration where application-level configuration indicated prompt caching was enabled, but Bedrock model invocation logs showed no cachePoint in the actual ConverseStream requests and cache read/write token usage remained zero. The proximate cause was following the stale cachePrompt / cacheTools option shape instead of the current cacheConfig API.
This is not the same as #895, which appears to be about the direct Anthropic provider and cross-SDK parity. This issue is specifically about BedrockModel TypeScript docs/config behavior.
Steps to Reproduce
There appears to be a public docs/source mismatch for Bedrock prompt caching in the TypeScript SDK.
Open this older/still-indexed TypeScript API page:
https://strandsagents.com/latest/documentation/docs/api-reference/typescript/interfaces/BedrockModelOptions.html
It lists
cachePrompt?: stringandcacheTools?: stringonBedrockModelOptions.Compare with the current TypeScript docs:
These show
cacheConfig?: CacheConfig, whereCacheConfig.strategyis'auto' | 'anthropic'. The Bedrock guide also says TypeScript tool caching is enabled throughcacheConfig, and that there is no separatecacheToolsoption.Install
@strands-agents/sdk@1.0.0and pass a config object shaped like the older docs suggest. This can happen without a TypeScript error if the object goes through an intermediate variable oras any:Invoke the model through an agent with a system prompt and/or tools, then inspect the actual Bedrock Converse/ConverseStream request body or cache usage metadata.
Expected Behavior
One of these should happen:
latest/documentation/docs/api-reference/...page should redirect to the current docs or be updated to showcacheConfig, notcachePrompt/cacheTools.cachePrompt/cacheToolsand map them to the current cache-point behavior.Actual Behavior
cachePromptandcacheToolsare silently ignored by@strands-agents/sdk@1.0.0's Bedrock provider. NocachePointis emitted from those fields.From the installed v1.0.0 source:
dist/src/models/bedrock.d.ts:BedrockModelConfigexposescacheConfig?: CacheConfig; nocachePrompt/cacheToolsfields.dist/src/models/model.d.ts:CacheConfigis{ strategy: 'auto' | 'anthropic' }.dist/src/models/bedrock.js:_shouldEnableCaching()reads onlythis._config.cacheConfig.cachePointonly when_shouldEnableCaching()is true.The upstream source appears to match this:
https://github.com/strands-agents/sdk-typescript/blob/a12ea3e3c4680daacc8ca5937b6b8be41474c92b/strands-ts/src/models/bedrock.ts
Minimal Request-Shape Check
Using the unsupported fields from the stale docs:
Using the current API:
Additional Context
AWS Bedrock requires explicit
cachePointcheckpoints in the Converse requestmessages,system, ortoolsfields for prompt caching:https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html
We hit this in an integration where application-level configuration indicated prompt caching was enabled, but Bedrock model invocation logs showed no
cachePointin the actualConverseStreamrequests and cache read/write token usage remained zero. The proximate cause was following the stalecachePrompt/cacheToolsoption shape instead of the currentcacheConfigAPI.This is not the same as #895, which appears to be about the direct Anthropic provider and cross-SDK parity. This issue is specifically about BedrockModel TypeScript docs/config behavior.