From d072bf1cb69dcd1dc3cfa910650ae32dbb17db35 Mon Sep 17 00:00:00 2001 From: iamtoruk Date: Mon, 18 May 2026 05:43:46 -0700 Subject: [PATCH] Fix OpenCode/Goose returning 0 sessions on fresh install SQLite-based providers use compound paths (db.path:sessionId) which caused fingerprintFile to fail stat() and silently skip all sessions. Fall back to stat on the DB file when the full compound path fails. Fixes #346 --- src/session-cache.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/session-cache.ts b/src/session-cache.ts index 7656818..2537a7d 100644 --- a/src/session-cache.ts +++ b/src/session-cache.ts @@ -235,6 +235,15 @@ export async function fingerprintFile(filePath: string): Promise 0) { + try { + const s = await stat(filePath.slice(0, colonIdx)) + return { dev: s.dev, ino: s.ino, mtimeMs: s.mtimeMs, sizeBytes: s.size } + } catch { + return null + } + } return null } }