diff --git a/src/main/ai-vault/session-scanner-opencode-sqlite-open.test.ts b/src/main/ai-vault/session-scanner-opencode-sqlite-open.test.ts index 45f1edbe6fb..017807640bf 100644 --- a/src/main/ai-vault/session-scanner-opencode-sqlite-open.test.ts +++ b/src/main/ai-vault/session-scanner-opencode-sqlite-open.test.ts @@ -250,14 +250,13 @@ describe('openCodeBusyTimeoutMs', () => { describe('openCodeDatabaseScanIssue', () => { const cantOpen = Object.assign(new Error('unable to open database file'), { errcode: 14 }) - it('names the wal-index over a WSL share rather than repeating the driver string', () => { - const issue = openCodeDatabaseScanIssue( - '\\\\wsl.localhost\\Ubuntu\\home\\ada\\.local\\share\\opencode\\opencode.db', - cantOpen - ) + it('states the WSL share as a known limitation rather than an error to act on', () => { + const dbPath = '\\\\wsl.localhost\\Ubuntu\\home\\ada\\.local\\share\\opencode\\opencode.db' + const issue = openCodeDatabaseScanIssue(dbPath, cantOpen) expect(issue.kind).toBe('scope') - expect(issue.message).toContain('\\\\wsl.localhost') + expect(issue.path).toBe(dbPath) + expect(issue.message).toBe("OpenCode sessions inside WSL can't be searched from Windows yet.") // Checkpointing cannot fix a share that refuses SQLite's locks, so the copy // must not send the user after the write-ahead log. expect(issue.message).not.toContain('write-ahead log') @@ -282,7 +281,7 @@ describe('openCodeDatabaseScanIssue', () => { ) expect(issue.message).not.toContain('is writing to') - expect(issue.message).toContain('inside the distro') + expect(issue.message).toBe("OpenCode sessions inside WSL can't be searched from Windows yet.") }) it('still blames a live writer for the same error on a local path', () => { diff --git a/src/main/ai-vault/session-scanner-opencode-sqlite-open.ts b/src/main/ai-vault/session-scanner-opencode-sqlite-open.ts index 0146962fa05..43e32da2ff5 100644 --- a/src/main/ai-vault/session-scanner-opencode-sqlite-open.ts +++ b/src/main/ai-vault/session-scanner-opencode-sqlite-open.ts @@ -99,16 +99,15 @@ export function openCodeDatabaseScanIssue(dbPath: string, error: unknown): AiVau ? `OpenCode is writing to ${name} right now, so its history was skipped. It is read again on the next refresh.` : kind === 'unreadable' ? `OpenCode history in ${name} could not be read: ${errorMessage(error)}` - : `OpenCode history in ${name} could not be read. ${unreadableShareAdvice(dbPath)}` + : unreadableShareDetail(dbPath, name) return { agent: 'opencode', kind: 'scope', path: dbPath, message: detail } } -function unreadableShareAdvice(dbPath: string): string { - // Named only when the evidence supports it; a generic share gets generic copy. - // Deliberately not "flush the write-ahead log": checkpointing changes nothing - // here, and telling the user to try it would send them after a fix that cannot - // work. The share itself is the blocker. +function unreadableShareDetail(dbPath: string, name: string): string { + // A known limitation, not a failure the user can act on: nothing they do on + // the Windows side makes the share hand out SQLite's locks. Deliberately not + // "flush the write-ahead log" either — checkpointing changes nothing here. return isWslUncPath(dbPath) - ? 'Windows cannot open SQLite databases over the \\\\wsl.localhost share, so this history has to be read from inside the distro.' - : 'Its write-ahead log cannot be opened read-only on this filesystem. Exit OpenCode cleanly to flush the log.' + ? "OpenCode sessions inside WSL can't be searched from Windows yet." + : `OpenCode history in ${name} could not be read. Its write-ahead log cannot be opened read-only on this filesystem. Exit OpenCode cleanly to flush the log.` }