[BUG] SQLite Migration Ate My Sessions! 😱 (But Desktop Survived!) #9348

Open
opened 2026-02-16 18:12:14 -05:00 by yindo · 4 comments
Owner

Originally created by @abbabb123 on GitHub (Feb 14, 2026).

Originally assigned to: @thdxr on GitHub.

Description

After upgrading to v1.2.0+, my CLI shows incomplete sessions while Desktop still sees the full history. It's like CLI is on a diet but Desktop is living its best life!

Steps to Reproduce

  1. Have many sessions from daily coding
  2. Upgrade to v1.2.0+ (SQLite migration happens)
  3. Open CLI - notice some sessions are MISSING
  4. Open Desktop - ALL sessions are there!

Evidence

Storage Sessions Messages
SQLite (CLI) ~1,350 ~45,000
storage/ (old flat files) 20 folders 1,456 files

The old storage folder still contains un-migrated data, but CLI only reads from SQLite.

Expected Behavior

ALL sessions should appear in CLI, not just the ones that survived the SQLite migration!

Actual Behavior

  • CLI only shows sessions that made it to SQLite
  • Desktop reads from the old storage like a time traveler
  • Some sessions exist in storage/ but NOT in SQLite
  • The migration gave up halfway through

Environment

  • OpenCode version: v1.2.1
  • OS: macOS

Workaround

Downgrading to v1.1.x restores access to all sessions.


PLZ FIX 🙏

The users who upgraded are crying. The sessions we can't see are crying harder.
Desktop is laughing. We are not.

Originally created by @abbabb123 on GitHub (Feb 14, 2026). Originally assigned to: @thdxr on GitHub. ## Description After upgrading to v1.2.0+, my CLI shows incomplete sessions while Desktop still sees the full history. It's like CLI is on a diet but Desktop is living its best life! ## Steps to Reproduce 1. Have many sessions from daily coding 2. Upgrade to v1.2.0+ (SQLite migration happens) 3. Open CLI - notice some sessions are MISSING 4. Open Desktop - ALL sessions are there! ## Evidence | Storage | Sessions | Messages | |---------|----------|----------| | SQLite (CLI) | ~1,350 | ~45,000 | | storage/ (old flat files) | 20 folders | 1,456 files | The old storage folder still contains un-migrated data, but CLI only reads from SQLite. ## Expected Behavior ALL sessions should appear in CLI, not just the ones that survived the SQLite migration! ## Actual Behavior - CLI only shows sessions that made it to SQLite - Desktop reads from the old storage like a time traveler - Some sessions exist in storage/ but NOT in SQLite - The migration gave up halfway through ## Environment - OpenCode version: v1.2.1 - OS: macOS ## Workaround Downgrading to v1.1.x restores access to all sessions. --- **PLZ FIX** 🙏 The users who upgraded are crying. The sessions we can't see are crying harder. Desktop is laughing. We are not.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 14, 2026):

Thanks for reporting this! Before we dive in, I wanted to check if this might be related to these existing issues:

  • #13611: SQLite migration issues when using opencode serve
  • #13600: TUI session loading failures

If your issue is distinct from these, we'll prioritize investigating the partial migration you're experiencing. The evidence table showing un-migrated data in the storage/ folder is particularly helpful for debugging this.

@github-actions[bot] commented on GitHub (Feb 14, 2026): Thanks for reporting this! Before we dive in, I wanted to check if this might be related to these existing issues: - #13611: SQLite migration issues when using `opencode serve` - #13600: TUI session loading failures If your issue is distinct from these, we'll prioritize investigating the partial migration you're experiencing. The evidence table showing un-migrated data in the storage/ folder is particularly helpful for debugging this.
Author
Owner

@thdxr commented on GitHub (Feb 14, 2026):

did you try deleting the sqlite database and letting the migration run again?

@thdxr commented on GitHub (Feb 14, 2026): did you try deleting the sqlite database and letting the migration run again?
Author
Owner

@thdxr commented on GitHub (Feb 14, 2026):

hey pushed some more fixes in 1.2.3 can you delete the sqlite file (can find it with opencode db path) and then run it to rerun the migration?

@thdxr commented on GitHub (Feb 14, 2026): hey pushed some more fixes in 1.2.3 can you delete the sqlite file (can find it with `opencode db path`) and then run it to rerun the migration?
Author
Owner

@lee-b commented on GitHub (Feb 15, 2026):

hey pushed some more fixes in 1.2.3 can you delete the sqlite file (can find it with opencode db path) and then run it to rerun the migration?

Is the sqlite database only a cache? If not, then deleting the DB doesn't sound like a valid solution to DB migration bugs -- it would apply an initial migration, not the buggy migration in question?

@lee-b commented on GitHub (Feb 15, 2026): > hey pushed some more fixes in 1.2.3 can you delete the sqlite file (can find it with `opencode db path`) and then run it to rerun the migration? Is the sqlite database only a cache? If not, then deleting the DB doesn't sound like a valid solution to DB migration bugs -- it would apply an initial migration, not the buggy migration in question?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9348