From cab2a57440cf7858f020b9696985de6e557628ac Mon Sep 17 00:00:00 2001 From: Evan Nadeau <1878498+evannadeau@users.noreply.github.com> Date: Wed, 13 May 2026 18:50:41 -0700 Subject: [PATCH 1/2] fix(orchestrator): preserve leading dash in projectHash for JSONL filewatcher projectHash mirrors how Claude Code names per-project dirs under ~/.claude/projects/. CC keeps the leading dash that comes from POSIX absolute paths (/home/foo -> -home-foo). The previous .replace(/^-+/, "") stripped that dash, producing 'home-foo' instead of '-home-foo' and silently pointing the agent-channel JSONL filewatcher at a directory that doesn't exist. The MCP server stayed up and tools answered, but no cross-session channel events were observed (and downstream features that depend on the watcher quietly broke). Reference: anti_pattern 6dfc7ae1. Co-Authored-By: Claude Opus 4.7 --- plugins/orchestrator/dist/server.js | 2 +- plugins/orchestrator/mcp/server.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/orchestrator/dist/server.js b/plugins/orchestrator/dist/server.js index 6b6141f..b91af96 100644 --- a/plugins/orchestrator/dist/server.js +++ b/plugins/orchestrator/dist/server.js @@ -26044,7 +26044,7 @@ function startAgentChannel() { `); return; } - const projectHash = projectDir.replace(/[\\/:]/g, "-").replace(/^-+/, ""); + const projectHash = projectDir.replace(/[\\/:]/g, "-"); const projectsHashDir = join5(homedir2(), ".claude", "projects", projectHash); const roleEnv = process.env.ORCHESTRATOR_AGENT_ROLE ?? process.env.SPAWNBOX_AGENT_ROLE; const role = roleEnv === "prime" ? "prime" : "subordinate"; diff --git a/plugins/orchestrator/mcp/server.ts b/plugins/orchestrator/mcp/server.ts index 85eed16..db7d7cf 100644 --- a/plugins/orchestrator/mcp/server.ts +++ b/plugins/orchestrator/mcp/server.ts @@ -2180,8 +2180,11 @@ function startAgentChannel(): void { // Project hash dir under ~/.claude/projects/. Hash mirrors how Claude Code // names the per-project directory: replace path separators + drive colons - // with hyphens, leading hyphens trimmed. - const projectHash = projectDir.replace(/[\\/:]/g, "-").replace(/^-+/, ""); + // with hyphens. Leading hyphens are preserved — CC retains the leading + // dash that comes from a leading slash on POSIX absolute paths (e.g. + // /home/foo -> -home-foo). Stripping them caused a silent path mismatch + // and broke the JSONL filewatcher entirely (see anti_pattern 6dfc7ae1). + const projectHash = projectDir.replace(/[\\/:]/g, "-"); const projectsHashDir = join(homedir(), ".claude", "projects", projectHash); // Role/name env vars: ORCHESTRATOR_AGENT_* is the canonical form (set by From 93c5da6a6ee2681fd90e84b10fed2b39d8c2b9bc Mon Sep 17 00:00:00 2001 From: Evan Nadeau <1878498+evannadeau@users.noreply.github.com> Date: Wed, 13 May 2026 19:13:49 -0700 Subject: [PATCH 2/2] fix(orchestrator): emit PLUGIN_VERSION in system_status (not hardcoded literal) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The system_status output line hardcoded "0.30.28" instead of using the ${PLUGIN_VERSION} constant that's already read from package.json at module load. The 0.30.31 cleanup (see lines 32-37 of mcp/server.ts) consolidated the version source specifically so it wouldn't be "hardcoded in multiple spots and forgotten on every other version bump" — but this single line at mcp/server.ts:655 was missed during that consolidation, and every bump since (0.30.32 → 0.30.38) shipped with the line still saying 0.30.28. Concrete symptom: running an up-to-date plugin and calling system_status returns "**Version**: orchestrator MCP server **0.30.28**" regardless of the actual package.json version. The startup banner (which uses PLUGIN_VERSION directly) reports correctly — only this line was wrong. Tested: bun run typecheck clean, bun test 516 pass / 0 fail, dist/server.js rebuilt via bun run build. Co-Authored-By: Claude Opus 4.7 (1M context) --- plugins/orchestrator/dist/server.js | 2 +- plugins/orchestrator/mcp/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/orchestrator/dist/server.js b/plugins/orchestrator/dist/server.js index b91af96..a238a58 100644 --- a/plugins/orchestrator/dist/server.js +++ b/plugins/orchestrator/dist/server.js @@ -24819,7 +24819,7 @@ server.tool("system_status", "Check the health of the orchestrator system: embed const lines = []; lines.push("## System Status"); lines.push(""); - lines.push(`- **Version**: orchestrator MCP server **0.30.28** (pid ${process.pid})`); + lines.push(`- **Version**: orchestrator MCP server **${PLUGIN_VERSION}** (pid ${process.pid})`); if (agentChannel) { lines.push(`- **Agent-channel**: ACTIVE - filewatcher running`); } else { diff --git a/plugins/orchestrator/mcp/server.ts b/plugins/orchestrator/mcp/server.ts index db7d7cf..da238de 100644 --- a/plugins/orchestrator/mcp/server.ts +++ b/plugins/orchestrator/mcp/server.ts @@ -652,7 +652,7 @@ server.tool( const lines: string[] = []; lines.push("## System Status"); lines.push(""); - lines.push(`- **Version**: orchestrator MCP server **0.30.28** (pid ${process.pid})`); + lines.push(`- **Version**: orchestrator MCP server **${PLUGIN_VERSION}** (pid ${process.pid})`); if (agentChannel) { lines.push(`- **Agent-channel**: ACTIVE - filewatcher running`); } else {