Skip to content
Back to skills

Roo Bedrock Custom Arn

ASecurity

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

  • 114 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 5, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add OnlyTerp/prompt-cache-skills --skill roo-bedrock-custom-arn --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Roo Bedrock Custom Arn?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Roo Bedrock Custom Arn
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/onlyterp-roo-bedrock-custom-arn/badge)](https://www.skillsdirectory.com/skills/onlyterp-roo-bedrock-custom-arn)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: roo-bedrock-custom-arn
description: Roo Code's Bedrock provider silently disables caching for custom ARNs. Populate cachableFields to fix.
target_harness: Roo Code
target_repo: RooCodeInc/Roo-Code
target_files:
  - src/api/providers/bedrock.ts
target_commit: main @ v3.54.0
estimated_savings: Enables Bedrock prompt caching for custom ARN setups (currently 0%)
---

# 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

```diff
--- 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](../../docs/concepts/bedrock.md).
Full audit: [audits/roo-code.md](../../audits/roo-code.md).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.