CedarCopilot wants to merge 1 commit into staging from fix/cache-breakpoint-ordering
Live on prod, no production signal yet
Unable to complete the production verification because the available telemetry query returned only wrapper logs and did not expose tied generateInput success/error counts or Anthropic cache_read_input_tokens usage.
Verification reached its budget before a verdict.
Verification showed no counted post-deploy activity, so Libra has no positive runtime evidence for how much traffic exercised this change. Original assessment: Production telemetry since 2026-09-15T14:29:14Z shows repeated strategist dispatches: at least 1,000 `run-strategist`.
Strict CloudWatch fallback saw 217,737 success-shaped log lines matching generateinput, updatenextstepsandtaskstool, conversation-field-updates, strategist-updates, conversation, but no tied operation was present, so Libra is not calling this working.
Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.
Unable to complete telemetry verification because the initial OTEL query timed out and no bounded follow-up telemetry query was executed.
internal_only
internal_only
internal_only
internal_only
internal_only
internal_only
internal_only
Libra has verdicts on 0 of 6 tracked behaviors on prod; 6 are still being checked. Libra checks hourly for 3 days after each deploy.
conversation-field-updates.ts (crm-updater), updateNextStepsAndTasksTool.ts (next-steps), and strategist-updates.ts (strategist) each build a manual "3-layer cached message" with two cache_control breakpoints: the triggering event's raw content first, then the (mostly stable, per-user) preamble/hydrated-context block, then an uncached task prompt.
Anthropic's prompt cache is prefix-based: a cache_control breakpoint only hits if the entire request content before it matches a previously cached prefix, byte for byte. Because the event-content block is a fresh email/meeting/Slack message on every call, it's never identical across runs , which meant the preamble/context breakpoint that came after it could never accumulate a cross-run cache hit either, since its cached prefix always included that call's unique event text.
Confirmed against real production billing/trace data via the understudy CLI: these three workloads showed cache-write dollars exceeding cache-read dollars by 1.9x,5.3x over a 6-day window (write should be small relative to read for healthy reuse), while a sibling workload with a stable-content-first order did much better.
The fix: reorder each generateInput so the stable block (preamble / hydratedContextBlock) comes first and keeps its cache_control marker. The event-content block's cache_control is removed , it's write-once-read-never regardless of position, so marking it cacheable only paid Anthropic's 1.25x cache-write markup for zero benefit , and it's merged into the uncached tail together with the existing task prompt. Same text, same order, no behavior change to what the model sees; only cache eligibility changes.
cache_control was removed from| file | block it was removed from |
|---|---|
conversation-field-updates.ts | the <new_content>${rawEventContent}</new_content> block |
updateNextStepsAndTasksTool.ts | the <event_content>${rawEventContent}</event_content> block |
strategist-updates.ts | the <new_content>${rawEventContent}</new_content> block |
In each case it's now merged uncached into the trailing block with the task prompt, and the block that keeps cache_control (preamble / hydratedContextBlock) moved to the front.
Derived from real Understudy billing data, not assumed:
cache_control on the volatile block, ~20% off its write cost (1.25x → 1.0x base rate), close to guaranteed with no dependency on traffic patterns: ~$14/day (crm-updater) + $19/day (next-steps) + $13/day (strategist) ≈ $46/day combined (~$1,380/month, ~$16,800/year).Effect A is low-risk and close to guaranteed. Effect B is a genuine estimate , confirm actual $ savings via a staged rollout comparing cache-read % before and after, rather than ass
Libra has not measured any production surfaces for this change yet.