Repository navigation
Description
Description
Archiving a session has no visible effect in the TUI: the session keeps showing up in the Ctrl+O session picker, indistinguishable from active ones, and selecting it opens it normally.
The API already has the filter — GET /api/session?archived=false returns no archived sessions — but the client lists them anyway, so "archive" cannot be used to keep the session list tidy. Today the only way to get an archived session out of the list is to delete it.
Plugins
Local CLI plugins (clear-session, git-status, sidebar-plugins) plus wsl-notify, opencode-roslyn, superpowers, btw-context, zen-failover.
The problem does not depend on them: it is visible from the API alone, and the stock Ctrl+O dialog renders the archived rows it receives.
OpenCode version
2.1.3
Steps to reproduce
- Create a session and send any prompt.
- Archive it:
opencode api patch /api/session/<sessionID> --data '{"archived":true}'
- Confirm the flag is stored:
opencode api get '/api/session?limit=50' | jq -r '.data[] | select(.time.archived) | "\(.id) \(.title) archived=\(.time.archived)"'
- Confirm the server-side filter works:
opencode api get '/api/session?limit=50&archived=false' | jq '[.data[] | select(.time.archived)] | length' # 0
- Open the TUI and press
Ctrl+O, then search for the session title: the archived session is listed and opens.
Expected Behavior
Archived sessions are hidden from the session picker by default (the same rows that ?archived=false removes), or at least marked as archived so they are distinguishable from active ones.
Actual Behavior
The archived session is listed like any active session and opens on select.
Additional Context
Evidence on 2.1.3 (Linux, WSL2):
$ opencode api get '/api/session?limit=50' | jq -r '.data[] | select(.time.archived) | ...'
ses_e98bca318ffexGreoXd6JqV5Sd Greeting archived=1792733839425
ses_ebf348006ffea85OfCCyiyNU5D Ping archived=1792733733726
ses_ebf34e8b5ffey1qe8UBcJgoOnp Ping archived=1792733716640
$ opencode api get '/api/session?limit=50&archived=false' | jq '[.data[] | select(.time.archived)] | length'
0
So the archived rows are returned by GET /api/session without the archived parameter, and the picker renders them as-is.
Related attempts, all closed without merge (they targeted the per-project server query, not the client):
- fix(session): exclude archived sessions from Session.list() query #24907
fix(session): exclude archived sessions from Session.list() query— closed by the automated PR cleanup (age/reactions, no review) - fix: filter archived sessions from per-project session list #27034 / fix: archived sessions pollute per-project session list #27030 per-project session list filtering — closed the same way / for missing the issue template
- v2: --continue reopens a session whose tab was closed; picks by time.updated with no closed/archived filter #52655
--continuealso ignores archived sessions (open)
Operating System
Ubuntu on WSL2 (Linux 6.18.33.2-microsoft-standard-WSL2, x64)
Terminal
Windows Terminal, TERM=xterm-256color, bash
Activity
opencode-agent commentedon Oct 23, 2026
Thanks for the detailed report and the API checks, @AlexeyShirshov.
You're asking for the TUI's
Ctrl+Opicker (and the session list) to hide archived sessions by default, or at least mark them, the same wayGET /api/session?archived=falsedoes. That would make archiving useful for keeping the list tidy.I checked the code: the server supports the filter, and the desktop/web app already hides archived sessions. The v2 TUI doesn't support archiving at all yet. It has no archive action, and its session queries (
dialog-open.tsx,dialog-session-list.tsx) don't filter byarchived. So this works as currently built, and I've filed it as a feature request: adding archive support to the TUI. Maintainers will consider it.Related issues:
--continuealso picks sessions without filtering out archived or closed onesAlexeyShirshov commentedon Oct 23, 2026
Some numbers from a real 2.1.3 setup (Linux/WSL2) to size the impact.
Scale
~/sources/nextorm6,758 ·~/sources/webpdca1,323 ·~/sources/opencode-config625 ·~/sources/skills147~/.local/share/opencode/opencode.db≈ 11.0 GiB, i.e. ~1.2 MB per session on averageWhy the missing filter hurts navigation
Ctrl+Odialog renders a recent-sessions window: 8 rows fit on screen and the rest are reached by scrolling. With 9,527 sessions and ~249 new ones per day, that window covers only a few hours of work — anything older is found by typing a search term only.GET /api/sessionand sit inside that window unmarked. In the current list, 2 of the ~8 visible rows were archived "Ping" sessions — indistinguishable from active ones. Selecting one silently reopens it, so it is easy to continue work in a session you believed was closed.time.updated, so it moves the session to the top of the recency window instead of out of it. Today archiving makes the list worse, not better:(
updated == archivedfor both — they were archived minutes ago and are now at the top.)PATCH /api/session/<id>or a client plugin (that is how the two sessions above were archived). So the one workaround a user has for a cluttered list is deleting, which loses the conversation and has no restore UI ([FEATURE]: view archived sessions on desktop #6680, [FEATURE]: ability to view and restore archived sessions via UI/CLI #26552).Suggestion
archived=falseby default indialog-open.tsx/dialog-session-list.tsx(the server filter already exists).Happy to test a build against this dataset.
feat(clear-session): портировать /clear из V1 на V2 CLI-API
fix(sessions): keep file archives and report TUI results
simPod commentedon Oct 29, 2026
Confirmed on OpenCode 2.2.0 (release), macOS arm64, iTerm2, zsh. Read-only checks of the picker query returned 15 archived sessions among 50; adding
archived=falsereturned zero archived sessions. Both project and all-project queries included a known archived root.The 2.2.0 picker source omits that filter and also leaves archived sessions in its local fallback. This blocks migration of file archives even when they are imported already archived.
Verification was through live API and source inspection, not a new interactive TUI reproduction. No sessions were imported or changed.