Environment: OpenCode GUI + CLI (Windows)
Issue: On June 25, CLI crashed while running a large task. Crashed again on restart. After that, GUI got stuck on "thinking..." every time I sent a message. Log showed ERR_SQLITE_ERROR, "SQL logic error". CLI recovered later, but GUI never did.
Debugging
- Suspected DB size
DB was 14.6GB. Ran VACUUM to shrink to 7.14GB → GUI still stuck.
- Found the bloat
Found 3220 sessions from a video analysis task taking up 6.2GB. Deleted them, VACUUM to 1.38GB → GUI still stuck.
- Suspected old data corruption
Deleted ALL sessions before June 25, VACUUM to 46MB → GUI still stuck.
At this point, both "DB too large" and "old session corrupted" were ruled out.
- Fresh DB
Renamed the old DB, launched GUI to create a brand new empty DB.
Sent a message → worked immediately.
Environment: OpenCode GUI + CLI (Windows)
Issue: On June 25, CLI crashed while running a large task. Crashed again on restart. After that, GUI got stuck on "thinking..." every time I sent a message. Log showed
ERR_SQLITE_ERROR, "SQL logic error". CLI recovered later, but GUI never did.Debugging
DB was 14.6GB. Ran VACUUM to shrink to 7.14GB → GUI still stuck.
Found 3220 sessions from a video analysis task taking up 6.2GB. Deleted them, VACUUM to 1.38GB → GUI still stuck.
Deleted ALL sessions before June 25, VACUUM to 46MB → GUI still stuck.
At this point, both "DB too large" and "old session corrupted" were ruled out.
Renamed the old DB, launched GUI to create a brand new empty DB.
Sent a message → worked immediately.