CoAgent8
    Preparing search index...

    Module sessions/history/reader

    Conversation history snapshot reading, LRU caching, and crash recovery.

    Reads consolidated .json snapshots or replays append-only .jsonl deltas. Each event's sequence is its 1-based stored log position; consolidating streaming assistant_delta records into an assistant_message keeps the first record's sequence while advancing nextSequence, so sequence gaps in consolidated history are expected and do not indicate lost events. Recovers from ungraceful process crashes by ignoring torn trailing lines, and maintains an in-memory snapshot cache bounded to 64 entries.

    clearHistoryCache
    deleteHistory
    getHistory
    getTurnMapping
    invalidateHistoryCache
    load
    sessionHistory