Skip to content

OpenCode truncation: cannot jump to matched messages that are not rendered #4

Description

@bojackduy

Problem

OpenCode's TUI only renders a limited window of conversation history. Older messages exist in the SQLite database but are not rendered in the session view. When Telescope finds a match in an older message and tries to jump to it, it cannot find the DOM node because it does not exist.

Root causes

  • jumpToRenderedTarget (ui/render-target.ts:20-45): Polls the render tree recursively looking for the message by ID. If OpenCode truncated it, the node never appears → polling times out → user lands at the top of the session instead of the matched message.
  • OpenCode behavior: The session view only renders a subset of messages (likely the last N). The rest are in the DB but not in the virtual DOM.

Suggested approach

  • Investigate OpenCode's truncation threshold
  • Options:
    • Send a command/key sequence to scroll up / load more before jumping
    • If OpenCode exposes an API to load a specific message range, use it
    • As a fallback: highlight the session name and suggest the user scroll up manually
    • Patch OpenCode to preserve the target ID and auto-scroll on render

Relevant files

  • ui/render-target.tsjumpToRenderedTarget, findRenderableTarget, polling logic
  • telescope.tsx:199-206open() function that navigates then jumps

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions