What your chat wrapper actually sends

One conversation. Four persistence strategies. The bytes on the wire, turn by turn.

Naive resend Refolding "summary" (the bug) Real summarizer Server-side state

Vertical axis: characters transmitted on a single request. Horizontal: turn number.

Totals across the whole conversation

StrategyFinal turnTotal sentEst. tokensvs server-side

What each strategy does

Naive resend — send the entire transcript every turn. Correct, simple, grows linearly. Cost per turn rises steadily; total cost rises quadratically.

Refolding "summary" — past a threshold, concatenate the old turns into one block and keep recent turns verbatim. Watch where this curve lands: exactly on top of naive resend, slightly above it. Joining N messages into one message removes no characters at all, and the "here is the conversation so far" preamble is re-added on every fold. You have the appearance of a summarizer and the cost of no summarizer, which is why it survives code review and runs for months.

Real summarizer — past the threshold, genuinely condense the old turns to a bounded recap and keep recent turns verbatim. Flat, and it stays flat.

Server-side state — send only the new turn; the provider holds the thread (OpenAI previous_response_id, or Anthropic compaction / Managed Agents). Constant.

Simulation only — no API keys, no network calls, nothing leaves this page. Companion to the article Your Chat Wrapper Is Re-Sending a Novel Every Turn.