Skip to content

tui: /timeline and transcript only show last ~20 messages — loadMore is never called #44618

Closed as duplicate

Description

@Climberwy

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

  1. 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.
  2. Close/reopen the TUI and resume that session (any directory).
  3. Run /timeline.
  4. 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 = 20
  • packages/client/src/solid/data.ts:1360 — message.sync calls api().message.list({ sessionID, limit: 20, order: "desc" }), one page only
  • packages/client/src/solid/data.ts:1385-1399 — loadMore() is fully implemented (cursor pagination, more() guard) but a grep for loadMore|messageCursor across packages/tui/src finds no callers
  • packages/tui/src/routes/session/dialog-timeline.tsx:22 — the timeline dialog reads data.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 /timeline displayed. 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 loadMore when 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

  1. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of an existing issue. Please check:

  2. opencode-agent commented on Aug 24, 2026

    @opencode-agent
    Contributor

    Duplicate of #44597.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions