Skip to main content

CONVERSATION_CAP

Constant CONVERSATION_CAP 

Source
pub const CONVERSATION_CAP: usize = 4_000;
Expand description

How many messages one copy of a conversation keeps.

Sized from the read that consumes it. Every page a client is handed is the newest twenty turns, and across the eight largest transcripts measured on a live machine that window spans 85 to 1,270 messages, with the heaviest twenty-turn run at 2,799 - so the cap holds every window any of them would serve. What it buys is a copy that stops tracking its transcript’s length: the live heap grew a pair of ~90MB contiguous buffers an hour through the copies that used to exist, and a copy held in a cap-sized window cannot reach one.

The count is one of two ceilings. CONVERSATION_CAP_BYTES bounds the same window by weight, because on the seats that made #1637 four thousand frames is not a bound a reader can feel.