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)
-
Backend session.list API (packages/opencode/src/v2/session.ts) returns ALL sessions including archived ones — no filtering at the query level.
-
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.
-
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:
- View a list of archived sessions
- Unarchive/restore a session (move it back to the main list)
Steps to reproduce
- Open OpenCode web/TUI/desktop
- Open a project with sessions
- Hover over a session in the sidebar and click the archive button (or press mod+shift+backspace)
- The session disappears from the sidebar
- There is no way to find or restore it through the UI
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
Root cause (from source code analysis)
Backend session.list API (packages/opencode/src/v2/session.ts) returns ALL sessions including archived ones — no filtering at the query level.
Frontend explicitly filters them out in three places:
The archiveSession function in packages/app/src/pages/layout.tsx:
Data is preserved
Archived sessions remain in the local SQLite database at:
with time_archived set. The data is intact — the UI just cannot access it.
Expected behavior
There should be a way to:
Steps to reproduce