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
Sessions present in opencode.db but missing from opencode-stable.db, making them invisible in TUI sidebar #21059
Active sessions are stored in opencode.db but are not synchronized to opencode-stable.db. The TUI sidebar appears to read from the stable database, so sessions that exist in the main DB become invisible even though they are fully intact and can be opened via opencode -s <session-id>.
Affected databases
File
Size
Role
opencode.db
44 MB
Main active database (WAL mode)
opencode-stable.db
208 KB
Stable snapshot copy
Steps to reproduce
Use opencode normally for multiple sessions
Exit and reopen opencode
Observe that some recent sessions are missing from the sidebar
Verify the session still exists in opencode.db:
python3 -c "import sqlite3conn = sqlite3.connect('opencode.db')c = conn.cursor()c.execute('SELECT id, title, time_created FROM session ORDER BY time_created DESC LIMIT 10')for row in c.fetchall(): from datetime import datetime print(f'{row[0]} | {row[1]} | {datetime.fromtimestamp(row[2]/1000).isoformat()}')"
Verify the same session is NOT in opencode-stable.db
Session can still be opened directly: opencode -s <session-id>
Session evidence
Session ID: ses_2a7574f8bffe5nU27s1zL3p74y
Title: Verificação de código e testes simples
Present in opencode.db: YES (created 2026-04-04T10:22, updated 2026-04-04T20:02)
Present in opencode-stable.db: NO
Storage files intact
Expected behavior
All sessions should be visible in the TUI sidebar. The stable database should either be kept in sync with the main database, or the sidebar should read from the main database.
System metadata
opencode version: 1.3.x (nixpkgs, via home-manager)
OS: Linux Mint (Nix standalone)
Additional context
The opencode-stable.db is only 208 KB while the main opencode.db is 44 MB, suggesting many sessions are missing from the stable copy. This may be related to the sync mechanism that creates the stable snapshot.
This issue might be a duplicate of existing issues. Please check:
/sessions TUI only shows recent sessions, ignores historical ones #16270: /sessions TUI only shows recent sessions, ignores historical ones — same symptom of sessions being present in opencode.db but not visible in the TUI, with detailed root-cause analysis of the stable DB / session list query
Session list missing in TUI mode #20238: Session list missing in TUI mode — same symptom of TUI displaying an incomplete session list vs what exists in the database
If your issue is specifically about the opencode-stable.db snapshot being out of sync (rather than the session-list query filtering), it may be a distinct root cause worth keeping open — but please review the above first to avoid duplicated effort.
Activity
github-actions commentedon Apr 5, 2026
This issue might be a duplicate of existing issues. Please check:
/sessions TUI only shows recent sessions, ignores historical ones— same symptom of sessions being present inopencode.dbbut not visible in the TUI, with detailed root-cause analysis of the stable DB / session list querySession list missing in TUI mode— same symptom of TUI displaying an incomplete session list vs what exists in the databaseWindows Desktop loses all session history after restart, but sessions still exist in opencode.db— nearly identical title and symptoms (data in DB, nothing shown in UI)If your issue is specifically about the
opencode-stable.dbsnapshot being out of sync (rather than the session-list query filtering), it may be a distinct root cause worth keeping open — but please review the above first to avoid duplicated effort.