Skip to content

Session not found when selecting sessions from TUI picker #12345

Closed

Description

@Limme-swe

Selecting a session from the TUI session picker sometimes shows "session not found" even though the session is listed right there. Happens more often after creating a new session or with older sessions that have a lot of messages.

Two causes:

  • Binary.search uses < but the session array is sorted with localeCompare, which gives a different ordering for mixed-case strings. Session IDs have base62 random suffixes so the binary search just misses entries that are in the array.

  • If any message or part file has corrupted JSON the messages endpoint returns 500 and the whole session becomes unloadable. The catch handler labels it "session not found" which is misleading.

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 5, 2026
  2. github-actions commented on Feb 5, 2026

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. ImGajeed76 commented on Feb 6, 2026

    @ImGajeed76

    damn, you really hit that 12345 id haha

  4. saadazghour commented on Feb 8, 2026

    @saadazghour

    Hi @zampxdev, @rekram1-node ,

    I’m experiencing the same issue.

    I had saved a session containing the full chat history for the codebase and application I’m working on. The session is clearly visible in the UI session picker and appears in the UI list. However, when I select it, I immediately receive a “session not found” error with the corresponding session ID.

    I’ve attached screenshots below that demonstrate:

    1. The session appearing in the picker list.

      Image
    2. The exact error message displayed after selection.

      Image

    Additionally:

    opencode export <session_id> fails with the same “Session not found” error, even though the session is listed.

    Image

    Environment:

    OS: Ubuntu 24.04.3 LTS x86_64

    OpenCode version:

    Image

    Output of opencode session list showing the session.

    Image
  5. raymelon commented on Feb 11, 2026

    @raymelon

    Having the same issue. In my case, the disk went full halting an ongoing subagent task inside the session.

    Managed to send a new message to recover the session only to get QUEUED.

    After restarting OpenCode, the session shows up in the TUI (session list) but is unloadable.

    The TUI briefly loads the session, so I know it's not completely gone, only to shoot me back to the home screen with the gigantic red alert saying "Session not found: ses_..."

    Session export does not work as well.

  6. github-actions commented on Apr 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions