Repository navigation
Description
Summary
The TUI only ever loads the newest 20 messages of a session into its local message store (messagePageLimit = 20) and never fetches older pages — Data.session.message.loadMore() exists but has zero callers in packages/tui/src. As a result /timeline (and the transcript scroll) silently show only the last few exchanges, which looks exactly like session history loss.
Environment
- opencode version: opencode2 v0.0.0-beta-18050
- OS: Linux 6.6.87.2-microsoft-standard-WSL2 (Windows Terminal + WSL2)
- Terminal: TERM=xterm-256color (Windows Terminal)
- Shell: /bin/bash
- Install/channel: npm global (
opencode2), beta channel - Active plugins:
~/.config/opencode/plugins/no-gpt5-defaults.ts
Reproduction
- Start a session and hold a long conversation where each user turn produces 10+ assistant/tool messages (e.g. a coding task with many tool calls). In my case: 9 user turns, 94 total messages.
- Close/reopen the TUI and resume that session (any directory).
- Run
/timeline. - Observe the list only contains the user messages that fall inside the newest-20-message window — for me exactly the last 3 turns.
Expected Behavior
/timeline lists all user messages of the session, or the TUI loads older messages on demand (scroll-to-top / opening the timeline dialog).
Actual Behavior
/timeline shows only the user messages within the latest 20 messages fetched at sync time. No UI path loads more, so older turns appear permanently missing.
Root cause chain (verified against v2 source):
packages/client/src/solid/data.ts:70—const messagePageLimit = 20packages/client/src/solid/data.ts:1360—message.synccallsapi().message.list({ sessionID, limit: 20, order: "desc" }), one page onlypackages/client/src/solid/data.ts:1385-1399—loadMore()is fully implemented (cursor pagination,more()guard) but a grep forloadMore|messageCursoracrosspackages/tui/srcfinds no callerspackages/tui/src/routes/session/dialog-timeline.tsx:22— the timeline dialog readsdata.session.message.list(sessionID), i.e. the truncated local store- The desktop app paginates properly (
packages/app/src/session/timeline/model.ts:18-58), so this is TUI-only
Additional Context
- Verified the data is intact server-side: the affected session has all 94 rows in
session_message(min seq 4, max seq 825); the newest 20 rows (seq 686+) contained exactly the 3 user turns that/timelinedisplayed. So this is purely a display/pagination defect, not data loss — but it presents as data loss to the user. - Workaround:
<leader>x(session.export) goes through the server API and exports the complete transcript. - Suggested fix directions: call
loadMorewhen the transcript is scrolled to the top, and/or have the timeline dialog fetch the full user-message list from the server instead of the paged local store.
Frequency: always reproducible for any session longer than one page. Originally suspected data loss after a TUI hang (frozen tab in Windows Terminal/WSL), but the SQLite data was never affected.
Activity
github-actions commentedon Aug 24, 2026
This issue might be a duplicate of an existing issue. Please check:
loadMoreis never invoked when scrolling to the top. SamemessagePageLimit = 20analysis, same regression introduced by commit6cd3da1on 2026-08-23.opencode-agent commentedon Aug 24, 2026
Duplicate of #44597.