From a1ffbcc771d406a0945669e644cc7b7bb17bb913 Mon Sep 17 00:00:00 2001 From: Russell Coleman Date: Fri, 27 Mar 2026 13:45:56 -0700 Subject: [PATCH] feat(imessage): add IMESSAGE_DB_PATH env var for testing Mirrors the existing IMESSAGE_STATE_DIR override. Lets a mock sqlite chat.db stand in for ~/Library/Messages/chat.db so chat_messages can be tested without macOS + Full Disk Access + real iMessage history. --- external_plugins/imessage/server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/external_plugins/imessage/server.ts b/external_plugins/imessage/server.ts index 45e33b1..2fc7a5c 100644 --- a/external_plugins/imessage/server.ts +++ b/external_plugins/imessage/server.ts @@ -33,7 +33,8 @@ import { join, basename, sep } from 'path' const STATIC = process.env.IMESSAGE_ACCESS_MODE === 'static' const APPEND_SIGNATURE = process.env.IMESSAGE_APPEND_SIGNATURE !== 'false' const SIGNATURE = '\nSent by Claude' -const CHAT_DB = join(homedir(), 'Library', 'Messages', 'chat.db') +const CHAT_DB = + process.env.IMESSAGE_DB_PATH ?? join(homedir(), 'Library', 'Messages', 'chat.db') const STATE_DIR = process.env.IMESSAGE_STATE_DIR ?? join(homedir(), '.claude', 'channels', 'imessage') const ACCESS_FILE = join(STATE_DIR, 'access.json')