Thread

R
Ruoqi11:10 AMOpen in Slack
Hi team — I think I found a prompt-caching bug in the backend and couldn't open a GitHub issue (interactions are restricted to prior contributors), so posting here.
TL;DR: On the Bedrock path, applyPromptCacheBreakpoints attaches ttl:"1h" to cache breakpoints for Claude 4.6 models, but on Bedrock only the 4.5 generation supports the 1-hour TTL — 4.6 is 5-minute only. Bedrock rejects the request (it doesn't silently downgrade), so a Bedrock + Opus/Sonnet 4.6 chat fails.
Where: platform/backend/src/routes/chat/normalization/apply-prompt-cache.ts:24
// comment says "4.5 and newer support a 1-hour cache TTL"
const ONEHOURCACHE_MODEL = /claude-(?:sonnet|haiku|opus)-4-[5-9](?!\d)/;
This matches 4.5–4.9, so 4.6 gets tagged 1h-capable. useOneHour (lines 90-94) then writes ttl:"1h" into the Bedrock cachePoint regardless of provider.
Why it's wrong (Bedrock-specific): AWS's docs list the 1h TTL set by exact version — only Opus/Sonnet/Haiku 4.5; the 4.6 rows say 5-minute only. (Note: on the Anthropic-direct API 4.6 does support 1h, so the bug is specific to the Bedrock path.) Unsupported TTL is a hard error on Bedrock — see the parallel report openclaw/openclaw#21986.
Repro: your own unit test already encodes it — apply-prompt-cache.test.ts:282 uses model: "us.anthropic.claude-opus-4-6-v1:0" and asserts ttl:"1h".
Fix: narrow the 1h allowlist (Bedrock → 4.5 generation only) and default to the 5-minute TTL for anything not on it, so newer/unknown models degrade to 5m instead of failing. Happy to open a PR with the patch + updated test if you can whitelist my account for contributions — just let me know.
(Found while doing academic research on prompt-caching bugs in OSS LLM apps; full writeup available if useful.)

1 reply
J(
joey (archestra team)12:24 PMOpen in Slack
hey! welcome.
if you'd like to open an issue just take a look at the "archestra banner" present at the bottom of every github issue/pr description (or head here in the docs and click-through to the contributor onboarding)