OpenParable
Skip to content
← Back to skills

Roo Bedrock Custom Arn

Agent Building
roo-bedrock-custom-arn

Roo Bedrock Custom Arn is an Agent Skill for agent building published in the OnlyTerp/prompt-cache-skills repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Roo Code's Bedrock provider silently disables caching for custom ARNs. Populate cachableFields to fix.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/OnlyTerp/prompt-cache-skills/blob/HEAD/skills/roo-bedrock-custom-arn/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/roo-bedrock-custom-arn, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

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:

  • Routing through a Bedrock-hosted Claude model with non-standard ARN
  • Using cross-region inference profiles
  • Provisioned throughput ARNs

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).
  2. Enable prompt caching in Roo settings.
  3. Capture wire via mitmproxy.
  4. Inspect outbound Bedrock Converse API request body:
    • Before fix: no cachePoint markers anywhere in the request
    • After fix: cachePoint: { type: "default" } blocks on system and last stable message
  5. Inspect response usage:
    • cacheWriteInputTokenCount > 0 on cold turn
    • cacheReadInputTokenCount > 0 on warm turn

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.