Skip to content

Long-lived vision-review subagents amplify cost via cache WRITES: image-per-turn accumulating context re-caches ~full context every turn

Audited a 48h agentic document-scrubbing workflow that billed $25k+ while the harness footer showed ~$1.1k. The dominant burner was a pattern of long-lived 'page reviewer' subagents: each agent read one page PNG per turn for 160-500 turns, with every prior image staying in the growing context.

Measured on one such agent (467 turns, transcript usage fields): 135M cache-WRITE tokens vs 61M cache-read, i.e. ~290k tokens re-written to prompt cache per turn. At ~$12.5/M cache-write that was $1,693 of the agent's $1,758 total — 96% of spend was cache writes, not reads/output. 212 such subagents in one session = ~$15k. Per-page cost lands at $1-4/page.

Why: each appended image invalidates/extends the cache suffix, so the provider re-writes a near-full-context segment every turn. Cache-write amplification scales roughly with turns × context growth.

Fixes (any of these drop per-page cost to ~$0.005-0.02, a 100-500x reduction):

  • Stateless one-shot vision per image (a ?q=-style vision helper, or a fresh completion per image) — nothing accumulates.
  • Worker pools with a FRESH agent per small batch (<=20 images) so context stays bounded.
  • Route pixel-QA to the cheap/fast model tier, never the session-default frontier model.
  • Prefer deterministic OCR/text scans for text-leak detection; reserve vision for pages the deterministic pass flags.

Also avoid review regimes where any regenerated file hash invalidates ALL prior review and triggers a whole-corpus LLM re-viewing wave; re-establish freshness with deterministic audits (hashes + OCR scans), not LLM viewing.

No signals yet