Recall's main connection (src/db/connection.ts:32-43) sets WAL + busy_timeout but no journal_size_limit (and wal_autocheckpoint is at SQLite default).
BrainLayer documents WAL ballooning to 4.7 GB and fixes it with these PRAGMAs. Red-team caveat: effort is understated — Recall opens DBs directly via new Database() in several places outside getDb():
hooks/lib/extraction-semaphore.ts
hooks/RecallExtract.ts
hooks/RecallStart.ts
hooks/lib/sqlite-writers.ts
Scope: add a shared pragma helper and apply it at every Recall DB writer, not just src/db/connection.ts.
journal_size_limit is the primary lever; wal_autocheckpoint is already sane at SQLite default. Verified bun:sqlite honors both PRAGMAs.
Recall's main connection (
src/db/connection.ts:32-43) sets WAL +busy_timeoutbut nojournal_size_limit(andwal_autocheckpointis at SQLite default).BrainLayer documents WAL ballooning to 4.7 GB and fixes it with these PRAGMAs. Red-team caveat: effort is understated — Recall opens DBs directly via
new Database()in several places outsidegetDb():hooks/lib/extraction-semaphore.tshooks/RecallExtract.tshooks/RecallStart.tshooks/lib/sqlite-writers.tsScope: add a shared pragma helper and apply it at every Recall DB writer, not just
src/db/connection.ts.journal_size_limitis the primary lever;wal_autocheckpointis already sane at SQLite default. Verifiedbun:sqlitehonors both PRAGMAs.