fix(hive-mind): use --mcp-config=<path> to stop variadic prompt slurp (#1780) (#1800)

Claude Code's `--mcp-config <configs...>` flag is variadic, so passing it
as two argv tokens lets a later positional argument — the hive-mind
prompt itself — get slurped as a second config file path. Once the
prompt grows past PATH_MAX (4000+ chars is normal for hive-mind),
`open(prompt)` fails with `ENAMETOOLONG: name too long`, the worker
never spawns, and `ruflo hive-mind spawn --claude` exits 1.

Use `=`-syntax (`--mcp-config=<path>`) so the flag stays attached to its
single value and the prompt is parsed as the prompt.

Closes #1780.
This commit is contained in:
rUv authored and GitHub committed 2026-05-06 16:53:30 -04:00
1 parent b9e2eb37e0
commit 23016fdfa5
1 file changed
+6 -1
@@ -274,7 +274,12 @@ async function spawnClaudeCodeInstance(
}
}
if (mcpConfigPath) {
claudeArgs.push('--mcp-config', mcpConfigPath);
// #1780 — Claude Code's `--mcp-config` is variadic; passing it as two
// argv tokens (`--mcp-config`, `<path>`) lets a later positional (the
// hive-mind prompt) be slurped as a second config file, producing
// `ENAMETOOLONG: name too long, open` once the prompt exceeds PATH_MAX.
// Use `=`-syntax so the flag stays attached to its single value.
claudeArgs.push(`--mcp-config=${mcpConfigPath}`);
output.printInfo(`Spawned worker MCP config: ${mcpConfigPath}`);
} else {
output.printWarning('No .mcp.json or ~/.claude.json found — spawned worker will not have mcp__ruflo__* tools (#1748 Issue 2). Pass --mcp-config <path> or run "ruflo init" to generate one.');