This repository was archived by the owner on Aug 17, 2026. It is now read-only.
feat: session tail rehydrate for large chat history - #22
Merged
Conversation
added 6 commits
July 16, 2026 19:32
Cold open and IDB persist keep only a newest-by-byte-budget tail (~4 MiB) instead of full-history replay. Server subscribe gains mode/window/fromSeq; client re-pins after hydrate and can page older history from the top.
Smoke fixes on top of mode:tail: - ChatView: only wheel/touch clears stick during hydrate (virtualizer pin no longer kills live follow) - load-older: no markReplaying/catch-up (avoid live-tail wipe) - IDB rehydrate seeds hasMoreOlder/minSeq; infer window meta when server omits it - windowEventsForSubscribe: lastSeq>0 is strict delta (disk full buffer must not re-send) - stale lastSeq rebuild uses cold tail window - explicit Load older messages control; batch send waits on back-pressure - Vite allowedHosts for zrok smoke
- Declare MessageHandlerDeps/ChatView Props/ReplayPersister contracts - Stale lastSeq: preserve legacy full mode; only explicit mode:tail windows - Disk load: reset when client lastSeq > loaded max, then cold rebuild - Load-older re-reduce keeps pending interactive asks - session_state_reset clears history-window/loadingOlder - loadingOlder clears only on isLast; no false hasMoreOlder on warm deltas - IDB put rechecks full array serialization against byte budget - Regression tests for client + server paths
- mode:tail disk-stale recovery test - ChatView load-older near-top/button + prepend compensation - virtualizer onChange compensates height when unstuck (D5 race)
Prevents vitest unhandled "window is not defined" when tanstack virtual notifies after jsdom teardown (CI suite error with all tests green).
Cherry-pick series onto main after upstream sync #17 diverged develop. Merge main scroll-to-top/ascent + selection pin with D5 prepend compensate, restore isSuperseded prop, align handler tests with reset delete semantics.
joeshull
requested review from
NathanielDake,
cmditch,
tomNummy and
tyler-keller
July 17, 2026 01:37
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Port session-tail-rehydrate to
mainafter upstream sync #17 madedevelop→mainnon-FF.Originally landed on develop via #13 (+ #20/#21 CI follow-ups). This PR cherry-picks the feature onto current
mainand merges main-only scroll-to-top/ascent + selection-pin behavior with D5 prepend compensation.Includes
mode:tail)Note
Main protection requires 1 approving review (enforce_admins). Please approve.
Supersedes conflicted #19.