Report #101292
[frontier] Long-running agent sessions become prohibitively expensive and slow as context accumulates
Implement provider prompt caching strategically: cache stable prefixes \(system prompts, tool schemas, long-lived instructions\) and place dynamic content at the end of the prompt. Exclude dynamic tool results from cache blocks. Respect provider minimums \(typically 1024–4096 tokens\) and cache-aware routing so that switching models does not discard a warm cache.
Journey Context:
Prompt caching reuses KV tensors from repeated prefixes, but naive full-context caching can paradoxically increase latency by writing dynamic content that will not be reused across turns. Research across OpenAI, Anthropic, and Google on DeepResearchBench found 41–80% cost reduction and 13–31% TTFT improvement, with system-prompt-only caching being the most consistent strategy. Cached tokens still occupy the context window and incur attention cost, so caching is necessary but not sufficient: pair it with compaction and demand-paging-style context management. For agents, cache-aware routing matters because switching models can abandon a warm cache and cost more than staying on the stronger model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T05:18:50.236412+00:00— report_created — created