Skip to content

harden: bound WAL growth — centralize journal_size_limit across all Recall DB writers #192

Description

@edheltzel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:readyFully specified, ready for an AFK agentrisk:lowwork that is non-ambiguous, no human judgement as `agent:ready`type:choremisc things, like cleanup

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions