From 5620301024e0bdb361d5cc4eba25010325282af6 Mon Sep 17 00:00:00 2001 From: Eyejoker Date: Wed, 25 Mar 2026 21:05:22 +0900 Subject: [PATCH] fix: pass EJCLAW_HOST_IPC_DIR to MCP server env for both runners MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Watcher tasks get task-scoped IPC dirs (data/ipc/{group}/tasks/{taskId}/), but the MCP server used HOST_IPC_DIR to write IPC files. Without EJCLAW_HOST_IPC_DIR, it fell back to the task-scoped path, writing cancel_task/send_message files to nested dirs the IPC watcher never scans. This caused 11 zombie watchers stuck in infinite loops — self-cancel calls silently failed with ~4000 stranded IPC files accumulating. Co-Authored-By: Claude Opus 4.6 --- runners/agent-runner/src/index.ts | 6 ++++++ src/agent-runner-environment.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/runners/agent-runner/src/index.ts b/runners/agent-runner/src/index.ts index a7226fb..a3a2b9f 100644 --- a/runners/agent-runner/src/index.ts +++ b/runners/agent-runner/src/index.ts @@ -640,6 +640,12 @@ async function runQuery( EJCLAW_IS_MAIN: containerInput.isMain ? '1' : '0', EJCLAW_AGENT_TYPE: process.env.EJCLAW_AGENT_TYPE || 'claude-code', + ...(process.env.EJCLAW_IPC_DIR && { + EJCLAW_IPC_DIR: process.env.EJCLAW_IPC_DIR, + }), + ...(process.env.EJCLAW_HOST_IPC_DIR && { + EJCLAW_HOST_IPC_DIR: process.env.EJCLAW_HOST_IPC_DIR, + }), }, }, ...(process.env.MEMENTO_MCP_SSE_URL diff --git a/src/agent-runner-environment.ts b/src/agent-runner-environment.ts index de9c939..c261233 100644 --- a/src/agent-runner-environment.ts +++ b/src/agent-runner-environment.ts @@ -279,6 +279,7 @@ args = [${JSON.stringify(mcpServerPath)}] [mcp_servers.ejclaw.env] EJCLAW_IPC_DIR = ${JSON.stringify(args.env.EJCLAW_IPC_DIR)} +EJCLAW_HOST_IPC_DIR = ${JSON.stringify(args.env.EJCLAW_HOST_IPC_DIR)} EJCLAW_CHAT_JID = ${JSON.stringify(args.chatJid)} EJCLAW_GROUP_FOLDER = ${JSON.stringify(args.group.folder)} EJCLAW_IS_MAIN = ${JSON.stringify(args.isMain ? '1' : '0')}