Skip to content

tui: 100-message cache silently truncates scrollback and transcript export #815

Closed

Description

@agenteinstinct1-max

Description

Long sessions lose access to older messages in the TUI, and TUI transcript export/copy uses that same incomplete cache.

Confirmed at dev-vibecoded 8c7ed51:

  • packages/tui/src/context/sync.tsx:616 requests only 100 messages; :638-664 keeps the newest 100, deletes older cached parts, then marks the session fully synced.
  • The live message.updated path (:354-371) also shifts out the oldest message and its cached parts above 100.
  • packages/tui/src/routes/session/index.tsx:1081-1106 exports messages() plus sync.data.part instead of fetching complete persisted history.

These are interface-store deletions, not evidence of persisted database deletion. In an isolated clean 8c7 runtime reproduction, importing 150 synthetic messages/parts and using CLI JSON export returned all 150 (first through last markers); SQLite still held 150. This does not establish recovery of any user's actual database or dirty build.

Expected: users can reach all persisted history and export/copy a complete transcript. Fix initial hydration and live eviction together, with real older-history retrieval if retaining a bounded render cache. Export/copy must not silently inherit a viewport/cache limit. Do not merely raise 100 or change model-context compaction. Preserve existing stored data.

Acceptance: a session exceeding 100 messages supports oldest-to-newest navigation; appending and reopening do not hide older history; transcript export/copy includes first and last markers and complete parts. Verify actual TUI pixels and real export contents, not only source assertions. No fix or Windows acceptance is claimed yet.

Plugins

No response

OpenCode version

Source/runtime base 8c7ed51; reported Windows build 0.0.1-dev.14800+8c7ed51.dirty

Steps to reproduce

  1. Create/import a disposable session with 150 uniquely marked messages and matching text parts.
  2. Open/reopen it in the TUI and try to navigate to marker 001.
  3. Export the transcript from the TUI and compare first/last markers and count against the full CLI JSON export.
  4. Append new messages and repeat, covering live eviction as well as initial hydration.

Screenshot and/or share link

No response

Operating System

Reported on Windows; isolated CLI persistence/export reproduction on Linux

Terminal

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions