Commit Graph

2 Commits

Author SHA1 Message Date
alan 608b6b8edb App: open a chat with one round trip
The thread controller asks chat_subscribe to carry the newest history page
(history: true, limit 200) and applies it from the reply; a server that
leaves the page out is asked with chat_messages as before. Deltas arriving
before the reply are recorded from the start of the subscribe, and settle
against the page's live_seq exactly as for a separate read.

Also documents the subscribe history field and benchmarks the indexed page
at limits 20 and 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 15:09:02 +00:00
alan 686690f7b4 Server: serve a Claude chat's history page from a per-file line index
Reading a history page parsed the whole session file (tens of MB) on every
chat_messages. A per-file index now records which lines build each shown
message; a page re-reads and replays only its own messages' lines, and the
index follows appends by reading only the new bytes. Results match the
whole-file read (compared page by page on synthetic transcripts); shapes the
index cannot replay exactly fall back to the whole-file read.

chat_subscribe may ask (history: true) for the newest page in its reply,
read once the subscription is attached, saving the client a round trip.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 14:58:57 +00:00