Roo bedrock custom arn

From OnlyTerp/prompt-cache-skills · View interactive version

Roo bedrock custom arn is an AI agent skill from the GitHub repository OnlyTerp/prompt-cache-skills. Roo Code's Bedrock provider silently disables caching for custom ARNs. Populate cachableFields to fix.

How to use this skill

Skill file

Roo Code: Bedrock custom ARN caching (#11983)

Target

src/api/providers/bedrock.ts → guessModelInfoFromId() in

RooCodeInc/Roo-Code.

Tracked upstream as issue #11983; PR #11984 proposes a fix but

status uncertain at audit time.

Symptom

When a user configures Bedrock with a custom ARN instead of one of

Roo's hardcoded model IDs, guessModelInfoFromId() returns

{ supportsPromptCache: true } but omits cachableFields. Downstream

the Bedrock provider checks for cachableFields and skips caching

entirely when empty. Net effect: silent 0% cache hit on custom ARNs.

Users hit this when:

Fix

--- a/src/api/providers/bedrock.ts
+++ b/src/api/providers/bedrock.ts
@@ guessModelInfoFromId(modelId: string)
   if (/* claude pattern match */) {
-    return { supportsPromptCache: true }
+    return {
+      supportsPromptCache: true,
+      cachableFields: ["system", "messages", "tools"],
+    }
   }

Apply this to every branch in guessModelInfoFromId() that returns

supportsPromptCache: true without populating cachableFields.

If PR #11984 is already merged at apply time, verify the fix

matches this shape and skip the diff.

Verify

  1. Configure Roo with a custom Claude ARN (any ARN not in the

declared model list).

  1. Enable prompt caching in Roo settings.
  2. Capture wire via mitmproxy.
  3. Inspect outbound Bedrock Converse API request body:

and last stable message

  1. Inspect response usage:

Background

Bedrock's Converse API uses a different field name (cachePoint)

than direct Anthropic (cache_control). Roo handles the translation

correctly for declared models but the custom-ARN detection path is

incomplete.

See docs/concepts/bedrock.md.

Full audit: audits/roo-code.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.