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>
This commit is contained in:
2026-12-03 15:09:02 +00:00
parent 686690f7b4
commit 608b6b8edb
7 changed files with 201 additions and 61 deletions
+12 -8
View File
@@ -394,14 +394,18 @@ func BenchmarkTranscriptNewestPageWholeFile(b *testing.B) {
func BenchmarkTranscriptNewestPageIndexed(b *testing.B) {
path := benchmarkFile(b)
if _, ok, err := indexedTranscriptPage(path, "ses_bench", nil, 100, ""); !ok || err != nil {
b.Fatal("index not served")
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
if _, ok, err := indexedTranscriptPage(path, "ses_bench", nil, 100, ""); !ok || err != nil {
b.Fatal("index not served")
}
for _, limit := range []int{20, 100} {
b.Run(fmt.Sprintf("limit%d", limit), func(b *testing.B) {
if _, ok, err := indexedTranscriptPage(path, "ses_bench", nil, limit, ""); !ok || err != nil {
b.Fatal("index not served")
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
if _, ok, err := indexedTranscriptPage(path, "ses_bench", nil, limit, ""); !ok || err != nil {
b.Fatal("index not served")
}
}
})
}
}