How a Self-Appending Summarizer Quadrupled Token Costs in a 1.4M-Conversation Agent

Good_Education4713 · reddit · 2026-10-08

An engineer dissects a cost anomaly in a 9-turn support agent handling 1.4M conversations/month: input tokens grew from 5,800 (turn 2) to 38,400 (turn 9), pushing p95 cost from $0.19 to $0.83 with no quality gain. Root cause: the summarizer appended the previous summary into each new one instead of replacing it, replaying its own history as context. Span-level token attribution revealed the bug; replacing the summary each turn flattened the curve without quality loss. Open question: reliably bounding evolving conversation state without losing detail.

Original post →

More from coding & agent

coding & agent channel →