Commit 32ed37c
fix(opencode): load usage from SQLite database (#982)
Read OpenCode session and assistant message rows from opencode.db before falling back to legacy JSON files. SQLite entries are opened read-only and take precedence by message/session id so migrated installations report current usage while older data remains supported.
Support both bun:sqlite and node:sqlite so development and packaged execution paths can read the migrated OpenCode database. Skip malformed SQLite rows independently so one bad row does not drop the whole database load, and cover SQLite loading plus JSON dedupe with in-source tests.
Co-authored-by: Hiroaki Ogasawara <13391129+xhiroga@users.noreply.github.com>
Co-authored-by: Cristos L-C <cristos@cristoslc.com>1 parent e663837 commit 32ed37c
1 file changed
Lines changed: 574 additions & 22 deletions
0 commit comments