From a5dda163eaf9326a68b610ad2493731ca917a6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Sat, 26 Sep 2026 00:13:56 +0300 Subject: [PATCH] fix: use fixed plugin data dir so mutex lock is shared across instances mkdtemp creates unique dirs per process, breaking the mutex. Use a fixed path ~/.opencode-matrix-plugin/ instead. --- index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 6785b24..8ea9925 100644 --- a/index.ts +++ b/index.ts @@ -5,7 +5,10 @@ import { SessionManager } from "./session-manager.js" import { loadConfig } from "./config-loader.js" import { log } from "./logger.js" -const PLUGIN_DATA_DIR = fs.mkdtempSync(`${os.homedir()}/.opencode-matrix-plugin-`) +const PLUGIN_DATA_DIR = `${os.homedir()}/.opencode-matrix-plugin` +if (!fs.existsSync(PLUGIN_DATA_DIR)) { + fs.mkdirSync(PLUGIN_DATA_DIR, { recursive: true }) +} const LOG_FILE = `${PLUGIN_DATA_DIR}/plugin.log` const SETUP_STARTED_LOG = `${PLUGIN_DATA_DIR}/setup-started.log` const SETUP_ERROR_LOG = `${PLUGIN_DATA_DIR}/setup-error.log`