Rolling chat summary at the top of the prompt busted prompt caching — here's the simple fix

npmBROKE · reddit · 2026-12-03

An indie developer of a Spanish practice bot traced two bugs to one wiring mistake: a tester's "Mexican Spanish" preference kept reverting, and API costs stayed high.

Root cause: a rolling chat summary sat at the top of the system prompt, ahead of the long correction rubric and few-shot examples. A background job rewrote the summary every 15 turns, shifting the byte prefix and busting the cache on everything below; four rounds of summarization had also blurred two explicit rules into "prefers casual practice."

Fix (no agent framework needed):

Result: cache hit rate recovered, and the bot reliably stuck to Mexican Spanish without dumping grammar tables.

Original post →

More from coding & agent

coding & agent channel →