sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

docs(bedrock): document CacheConfig(strategy="auto") gap with ARN-based inference profiles

Open Zelys-DFKH opened this issue 5 months ago • 3 comments

Description

CacheConfig(strategy="auto") silently skips caching when model_id is an ARN-based application inference profile. The _cache_strategy detection checks for "claude" or "anthropic" in the model ID string. Cross-region inference profile IDs like us.anthropic.claude-sonnet-4-20250514-v1:0 pass that check, but application inference profile ARNs are opaque resource identifiers with no model name, so detection returns None and caching is skipped.

This adds a troubleshooting note to the existing Bedrock model provider page explaining the root cause and documenting strategy="anthropic" as the fix.

Related Issues

Fixes #2233 Fixes #2601

Type of Change

Documentation update

Testing

Docs-only change — no code logic modified. MDX structure validated against existing patterns in the file.

  • [x] I have read the CONTRIBUTING document
  • [x] I have added any necessary tests that prove my fix is effective or my feature works
  • [x] I have updated the documentation accordingly
  • [x] I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • [x] My changes generate no new warnings
  • [x] Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Thanks to @mrtj for the detailed root-cause analysis in the issue.

Zelys-DFKH avatar Jun 02 '26 21:06 Zelys-DFKH

It needs conflicts to be resolved.

poshinchen avatar Jun 11 '26 19:06 poshinchen

Thanks for the contribution, but this PR is introducing a whole new page. All that's needed is a note on the existing bedrock model provider page. Please update to reduce scope (and use our PR template please!), setting to auto-close if no activity.

opieter-aws avatar Jun 11 '26 19:06 opieter-aws

Updated per feedback. Changes now go into the existing bedrock page's Troubleshooting section, not a new file. Conflicts resolved.

Zelys-DFKH avatar Jun 11 '26 22:06 Zelys-DFKH

Assessment: Approve

Clean, well-scoped docs-only change (+40 lines). I verified every technical claim against the source and they are all accurate.

Review details

Verified against source:

  • Python _cache_strategy (strands-py/src/strands/models/bedrock.py:208-216) checks for "claude"/"anthropic" substrings — matches the doc exactly.
  • The quoted warning string matches bedrock.py:522-525 verbatim, and the auto → detect → None → skip flow matches bedrock.py:517-527.
  • TS provider (strands-ts/src/models/bedrock.ts:462-466) behaves identically (MODELS_SUPPORTING_ANTHROPIC_CACHING = ['anthropic', 'claude']), so the TS tab is justified.
  • All imports are valid: BedrockModel/CacheConfig are exported from strands.models; TS paths (@strands-agents/sdk, .../models/bedrock) match package.json exports.
  • <Tabs>/<Tab label="..."> usage and the plain ### Troubleshooting subheading match existing conventions in the file (21 prior Tabs uses, no import needed).

Process: Scope was correctly reduced to a note on the existing page per @opieter-aws's feedback, conflicts resolved, and the PR now reports mergeable. No API surface changes, so no API bar-raising review needed.

Non-blocking: One inline suggestion to make the root-cause prose language-neutral since the section serves both Python and TS readers.

Nice contribution — accurate root-cause writeup with a clear, actionable fix.

github-actions[bot] avatar Jun 19 '26 17:06 github-actions[bot]

Documentation Preview Ready

Your documentation preview has been successfully deployed!

Changed pages:

Updated at: 2026-06-19T17:50:39.192Z

github-actions[bot] avatar Jun 19 '26 17:06 github-actions[bot]