Skip to content

TUI: opening a long session waits for its last 100 messages before drawing #53428

Closed

Description

@moritzWa

Description

Opening a session in the TUI (from the session list, or via /tui/select-session) fetches its last 100 messages before the session is drawn. For long sessions that request is most of the switch time: in my logs the 100-message fetch takes about 290–430 ms, while the last 20 messages of the same sessions come back in 7–8 ms.

Twenty messages already fill a tall terminal, so the rest could load after the session is on screen. The full fetch is also wasted for sessions you only pass through while switching, and its layout blocks input for a moment.

Plugins

None

OpenCode version

1.18.34, and current dev

Steps to reproduce

  1. Have two sessions with a few hundred messages each
  2. Switch between them from the session list (ctrl+x l)
  3. Each switch pauses before the session appears, longer for longer sessions

Operating System

macOS

Terminal

Hyper

Activity

  1. added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Oct 5, 2026
  2. github-actions commented on Oct 7, 2026

    @github-actions
    Contributor

    Thanks for updating the issue with the reproduction steps and system details!

  3. neriousy commented on Oct 19, 2026

    @neriousy
    Member

    The v2 TUI initially fetches the newest 20 messages and loads older history in additional pages. Opening a session no longer requires the reported initial 100-message fetch. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.

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

Metadata

Metadata

Assignees

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