Skip to content

TUI /sessions only show sessions from last 30 days, while CLI session list shows all my sessions (thank god) #16733

Closed as not planned

Description

@raymelon

Description

What breaks:

The TUI /sessions picker only shows recent sessions and makes it look like older sessions are gone.

What still works:

opencode session list shows the full session history, and the CLI docs say session list should "List all OpenCode sessions."

Why this is concerning

The mismatch between TUI and CLI creates a false data-loss scare and blocks work.

Expected behavior:

  • TUI /sessions should show the same session history that the CLI can list.
  • My entire session to stay unless I decide to prune them

Actual behavior:

TUI only shows recent sessions, while CLI can still see the old sessions

Official docs reference:

OPENCODE_DISABLE_PRUNE is documented as Disable pruning of old data, so users may assume old sessions are protected; the UI should not suggest they vanished when they still exist.

Related issue:

#13877: the existing report says the /sessions picker "only shows a small set of recent sessions."

Help me confirm the accuracy of this:

  • Setting OPENCODE_DISABLE_PRUNE=true for future protection of my sessions, because that is the only official deletion-related control I could verify
  • Keep using opencode session list plus opencode session resume <session_id> until the TUI bug is fixed, because the CLI docs explicitly support listing all sessions and resuming by session ID.

Related issues

Plugins

@ramarivera/opencode-model-announcer

OpenCode version

1.2.22

Steps to reproduce

  1. Update to 1.2.22
  2. Open TUI (opencode)
  3. Write /sessions
  4. Scroll all the way down only to see that sessions over 30 days are hidden
  5. Exit TUI
  6. Run opencode list sessions and thank the gods that older sessions are still listed there

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

Windows Terminal

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 9, 2026
  2. github-actions commented on Mar 9, 2026

    @github-actions
    Contributor

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

    Both issues describe the same behavior you're experiencing. Consider adding your findings as comments there instead.

  3. bobcodev commented on Mar 29, 2026

    @bobcodev

    Version 1.3+ the problem persists :(

  4. added 2 commits that reference this issue on Mar 29, 2026
    c31be25
    218aad8
  5. jchuder commented on Apr 16, 2026

    @jchuder

    v1.4.6 same here.

    Not sure whether the hardcoded 30 day cutoff was introduced as a defensive measure for memory/startup costs, especially given the memory discussion in #20695. But after looking at the current behavior, I think session discovery and session content loading should be separate to 2 problems.

    My suggestion:

    1. The tui session list should not hide older sessions behind a hard 30 day cutoff. It should support pagination or infinite scroll more for older sessions instead. Search should be an accelerator, not the only way to discover sessions older than the current cutoff.(I tried to search some keywords to search over 30 day's old session missing in session list and the result is I can get old session in list as expected behavior.)
    2. The session list only needs lightweight metadata such as id, title, updatedAt, and maybe workspace/status info. That is much cheaper than full message history, diffs, or snapshots...etc, so session discovery should be solved separately from heavy session hydration.
    3. Once a session is opened, large message histories should not be handled by loading the entire session into memory. A better approach would be:
      • load the most recent chunk of messages first
      • fetch older chunks when scrolling to the top
    4. So the long term fix here probably is not “remove the cutoff and load everything”, but rather:
      • bounded initial loading for session list metadata
      • pagination / infinite scroll for older sessions
      • lazy chunk loading for opened session content

    This seems aligned with the follow up direction discussed in #17046 and #13877 as well, where count-based limits and pagination / load more were already suggested as better UX than a hard time window.

  6. assigned and unassigned on Apr 26, 2026
  7. mr-yifeiwang commented on Apr 28, 2026

    @mr-yifeiwang

    The problem still exists in v1.4.10.

    The mismatch between sessions shown in the TUI and CLI is somewhat confusing. If the two interfaces are meant to reflect the same session state, it will make sense for them to stay consistent: when a session is deleted in the TUI, it shall no longer appear in opencode session list; and likewise a session deleted via CLI shall no longer appear in the TUI.

    If the current mismatch is intentional, clearer documentation around that behaviour may help. In that case, a bulk cleanup command such as opencode session clear can also be useful, so users will not need to delete sessions one by one.

    Thanks for looking into this.

  8. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  9. EdgarSedov commented on May 30, 2026

    @EdgarSedov

    Still affected by this. #26432 looks like the most focused active fix for the 30-day picker cutoff / hidden older sessions issue.

  10. Necmttn commented on Jun 21, 2026

    @Necmttn

    The TUI should distinguish filtered from missing.

    A low-risk fix is to show the active window (last 30 days), total indexed sessions if known, and an explicit load older / search-all path. If a session is actually pruned or deleted, that should be a different state from hidden by current filter.

    That avoids the false data-loss signal while still letting the TUI keep initial load bounded.


    Generated with ax.

  11. github-actions commented on Aug 21, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions