You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session.list() includes archived sessions in LIMIT window, causing unarchived sessions to disappear from sidebar #24850
Sessions disappear from the Web UI sidebar after archiving other sessions, because the server-side Session.list() query includes archived sessions in its LIMIT window, which are then stripped client-side by trimSessions.
Steps to Reproduce
Accumulate many sessions in a project (e.g., 100+ root sessions)
Archive a batch of old sessions
Observe that archiving bumps time_updated on each archived session
The sidebar now shows fewer sessions than expected — some previously visible unarchived sessions have disappeared
Root Cause
The instance-scoped Session.list() function (packages/opencode/src/session/session.ts) does not filter out archived sessions:
Server fetches top N sessions by time_updated DESC — including archived ones
Recently archived sessions have bumped time_updated, so they fill the top of the result set
Client strips archived sessions, leaving fewer than limit unarchived sessions
Older unarchived sessions that were pushed past the server-side limit are silently lost
Expected Behavior
The instance-scoped list() should exclude archived sessions server-side (matching listGlobal's behavior), so the full limit is used for unarchived sessions.
Suggested Fix
Add isNull(SessionTable.time_archived) to the conditions in Session.list():
This issue identifies a specific server-side root cause: Session.list() doesn't exclude archived sessions from the query, so archived sessions consume LIMIT slots that get discarded client-side by trimSessions. This is especially visible after bulk-archiving sessions, since archiving bumps time_updated and pushes the archived sessions to the top of the result set.
Until this is fixed, if an active session disappears from the sidebar after archiving, you can bump it back into the fetch window by touching its time_updated via the API:
This sets time_updated to now, pushing the session to the top of the list.
Visiting the session directly in the Web UI also bumps it, but navigating away and back may cause it to disappear again if it falls below the fetch limit.
Activity
simianhacker commentedon Apr 28, 2026
Possibly related:
This issue identifies a specific server-side root cause:
Session.list()doesn't exclude archived sessions from the query, so archived sessions consumeLIMITslots that get discarded client-side bytrimSessions. This is especially visible after bulk-archiving sessions, since archiving bumpstime_updatedand pushes the archived sessions to the top of the result set.simianhacker commentedon Apr 28, 2026
Workaround
Until this is fixed, if an active session disappears from the sidebar after archiving, you can bump it back into the fetch window by touching its
time_updatedvia the API:This sets
time_updatedto now, pushing the session to the top of the list.Visiting the session directly in the Web UI also bumps it, but navigating away and back may cause it to disappear again if it falls below the fetch limit.
fix(session): exclude archived sessions from project list by default
feat(session,app,tui): restore and browse archived sessions (#18)
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.