Skip to content
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
joeshull merged 6 commits into
mainfrom
ship/session-tail-rehydrate-main
Jul 17, 2026
Merged

feat: session tail rehydrate for large chat history#22
joeshull merged 6 commits into
mainfrom
ship/session-tail-rehydrate-main

Conversation

@joeshull

Copy link
Copy Markdown

Summary

Port session-tail-rehydrate to main after upstream sync #17 made developmain non-FF.

Originally landed on develop via #13 (+ #20/#21 CI follow-ups). This PR cherry-picks the feature onto current main and merges main-only scroll-to-top/ascent + selection-pin behavior with D5 prepend compensation.

Includes

  • ~4 MiB newest-byte tail rehydrate (client IDB + server mode:tail)
  • Load-older pages + history window meta
  • Live-follow after hydrate (gesture-gated stick)
  • Prepend scroll-height compensation (D5)
  • Focused tests (101 green locally)

Note

Main protection requires 1 approving review (enforce_admins). Please approve.

Supersedes conflicted #19.

Joe 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
joeshull merged commit 2976892 into main Jul 17, 2026
1 check passed
@joeshull
joeshull deleted the ship/session-tail-rehydrate-main branch July 17, 2026 01:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant