Skip to content

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

@LifetimeVip

Description

@LifetimeVip

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions