feat(tui): load conversation and session history #8999
+218
−157
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
Adds on-demand message loading UI to the TUI, enabling users to access message history beyond the initial 100-message window.
Depends on: #8996 (adds
ts_beforeandbreakpointAPI parameters)Problem
Users cannot access message history beyond the initial 100 messages loaded on session init:
Solution
Two loading modes accessed via a "Load more messages" banner when 100+ messages are present:
Key features:
ts_beforetimestamp anchoring)Why Two PRs?
This PR was split from the original #8627 to separate concerns:
feat(session): add ts_before and breakpoint params to Session.messages API #8996 (API foundation) - Adds
ts_beforeandbreakpointparams toSession.messages(). This is a foundational capability that benefits:This PR (TUI consumer) - Implements the user-facing feature using the API
This separation allows the API enhancement to merge independently and unblock multiple consumers.
Implementation
Client (
sync.tsx):loadConversationHistory()- calls API withbreakpoint: trueloadFullSessionHistory()- calls API without breakpointUI (
routes/session/index.tsx):__load_more__message prepended when 100+ messagesScreenshots
From original PR #8627:
Option to load conversation or full session:

Loading conversation history:

Loading full session history:
