Skip to content

Archived sessions disappear permanently with no way to view or restore them #26078

Closed as not planned

Description

Description

The "Archive session" feature (keyboard shortcut: mod+shift+backspace, or the archive button on each session row in the sidebar) marks a session as archived (time.archived timestamp in SQLite) and removes it from the sidebar. However, there is no UI to view archived sessions or restore/unarchive them. Once archived, the session is gone from the UI permanently.

This is a significant UX issue — the action is destructive with no undo path.

Affected versions

  • Web UI (opencode web): confirmed
  • TUI: likely affected
  • Desktop app: likely affected

Root cause (from source code analysis)

  1. Backend session.list API (packages/opencode/src/v2/session.ts) returns ALL sessions including archived ones — no filtering at the query level.

  2. Frontend explicitly filters them out in three places:

    • packages/app/src/context/global-sync.tsx (loadSessions, ~line 172): .filter((s) => !s.time?.archived)
    • packages/app/src/context/global-sync/session-trim.ts (~line 30): .filter((s) => !s.time?.archived)
    • packages/app/src/context/global-sync/event-reducer.ts (~line 69): when a session.updated event with time.archived is received, the session is spliced from the store.
  3. The archiveSession function in packages/app/src/pages/layout.tsx:

    • Calls session.update with time: { archived: Date.now() }
    • Removes session from local store via splice
    • Navigates away from the session
    • No unarchive/view archived UI exists

Data is preserved

Archived sessions remain in the local SQLite database at:

  • Windows: %APPDATA%\opencode\opencode.db
  • Linux: ~/.local/share/opencode/opencode.db
  • macOS: ~/Library/Application Support/opencode/opencode.db

with time_archived set. The data is intact — the UI just cannot access it.

Expected behavior

There should be a way to:

  1. View a list of archived sessions
  2. Unarchive/restore a session (move it back to the main list)

Steps to reproduce

  1. Open OpenCode web/TUI/desktop
  2. Open a project with sessions
  3. Hover over a session in the sidebar and click the archive button (or press mod+shift+backspace)
  4. The session disappears from the sidebar
  5. There is no way to find or restore it through the UI

About the duplicate flag: This issue provides detailed root cause analysis with exact code locations (3 frontend filter points, the archiveSession function) that the earlier issues (#13463, #24153) do not include. It also documents the data preservation path (SQLite schema) which is useful for implementing a fix.

Activity

  1. github-actions commented on May 6, 2026

    @github-actions
    Contributor

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

    Please review these issues and consider whether your report adds new information beyond what's already tracked there.

  2. rekram1-node commented on Jun 22, 2026

    @rekram1-node
    Collaborator

    STOP SPAMMING ISSUES.

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