Repository navigation
feat(chat): open Claude transcripts from the tail - #693
Merged
Merged
Conversation
This was referenced Nov 19, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opening a saved Claude chat sent the last 32 MiB of its transcript as one agent RPC response. Over SSH that took 3.1 s at 100 Mbps, 14 s at 20 Mbps and 56 s at 5 Mbps; at 5 Mbps every run exceeded the 30 s RPC deadline, so the chat could not open at all. Sending only the last ~512 KiB measured 0.07 s, 0.28 s and 1.0 s on the same links.
The desktop now loads the recent tail first and reads earlier history on demand.
chat.transcriptPage): an internal agent RPC that reads the transcript backwards withReadAt, up to 20 recent turns within a ~512 KiB serialized budget. A cursor is bound to session, profile, file generation and position; truncation, file replacement, profile change and agent replacement invalidate it, while appends keep the snapshot. The 32 MiB retention window is unchanged. A row larger than the budget is sent as base64 fragments.ChatHostand a desktop IPC call expose pages. Only anunsupported-methodreply on the first request falls back to the old fullchat.transcript(older agents); I/O and connection errors are passed through rather than retried with the large read.chat.read/chat.watchandremote-protocolare unchanged: they still build the full projection, so mobile keeps its current item keys and indices. A cold mobile open still pays the full transfer; improving that needs a protocol change and is out of scope.Tests
TestTranscriptPages(one table): UTF-8, CRLF, partial and complete final lines, oversized-row fragments, retention limit, inclusive/exclusive cuts, append vs truncate/replace/profile/agent cursor invalidation, response frame size.Combined with current develop:
go vet,GOOS={windows,linux,darwin} go build,go test ./...,bun run typecheck,bun run check:ci,bun test4,464 pass / 17 skip / 0 fail.Follow-ups from the app check
beforeAnchor, verified against the session file), with no duplicated or missing rows. If the anchor does not match, it falls back to the full read.chat.transcriptPagefalls back to the full read.Manual checks before release
chat.readcan still page back past the desktop's loaded tail.🤖 Generated with Claude Code