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
Fallback OpenCode CLI import to pre-1.14 JSON storage when opencode.db is missing #977
OpenCode CLI import (#976) only reads OPENCODE_HOME/opencode.db (SQLite session/message/part). Pre-1.14 OpenCode stored JSON at ~/.local/share/opencode/storage/session//.json plus message/ and part/ trees.
Add a fallback walk of that JSON layout when opencode.db is missing or has no session table.
Constraints:
Do not copy the OpenCode store
Do not touch reclaim (absorbSessionTurns / setEjected / findOpenCodeSessionFile)
Ignore renderer-supplied home on IPC
Follow listOpenCodeSessions / importOpenCodeSession in electron/cli-sessions.js
Extend electron/test/cli-sessions.test.js with a JSON-only fixture home
Steps:
Failing module tests: list + import from a JSON-only fixture (no opencode.db)
Fallback when db exists but has no session table
Keep SQLite as the source of truth when the session table exists (do not double-count leftover JSON)
Implement the walk without leaving storage/ and without copying files
JSON fallback is in listOpenCodeSessions / importOpenCodeSession. When OPENCODE_HOME/opencode.db is missing or has no session table, the scan walks storage/session//.json plus message/ and part/ trees. SQLite remains the source of truth when the session table exists. Store is not copied; reclaim is unchanged; IPC still ignores renderer home. electron/test/cli-sessions.test.js JSON-only fixture + existing SQLite tests: 44 passing; IPC: 2 passing.
Activity
currentbits commentedon Sep 6, 2026
JSON fallback is in listOpenCodeSessions / importOpenCodeSession. When OPENCODE_HOME/opencode.db is missing or has no session table, the scan walks storage/session//.json plus message/ and part/ trees. SQLite remains the source of truth when the session table exists. Store is not copied; reclaim is unchanged; IPC still ignores renderer home. electron/test/cli-sessions.test.js JSON-only fixture + existing SQLite tests: 44 passing; IPC: 2 passing.