From d13954493ea672d00a62fdd64f6329c1faa17025 Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 12 Aug 2025 15:00:11 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/src/cli/simple-commands/hive-mind.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/checkpoints/task-1755010637.json | 1 + src/cli/simple-commands/hive-mind.js | 25 +++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .claude/checkpoints/task-1755010637.json diff --git a/.claude/checkpoints/task-1755010637.json b/.claude/checkpoints/task-1755010637.json new file mode 100644 index 0000000000..031a9d24b0 --- /dev/null +++ b/.claude/checkpoints/task-1755010637.json @@ -0,0 +1 @@ +{"checkpoint": "task-20250812-145716", "task": "the non-interactive args don't seem to insert the default prompt in the same way the interactive cla", "timestamp": "2025-08-12T14:57:17Z", "commit": "c7ec78db0d947c344decb1678976133988fbebf0", "github_release": "true"} diff --git a/src/cli/simple-commands/hive-mind.js b/src/cli/simple-commands/hive-mind.js index 9b1b6ea040..1cf1dadf70 100644 --- a/src/cli/simple-commands/hive-mind.js +++ b/src/cli/simple-commands/hive-mind.js @@ -2005,10 +2005,18 @@ async function spawnClaudeCodeInstances(swarmId, swarmName, objective, workers, // Respect --non-interactive flag regardless of --claude const isNonInteractive = flags['non-interactive'] || flags.nonInteractive; - // Pass the prompt directly as an argument to claude - const claudeArgs = [hiveMindPrompt]; + // Build arguments in correct order: flags first, then prompt + const claudeArgs = []; + + // Add non-interactive flags FIRST if needed + if (isNonInteractive) { + claudeArgs.push('-p'); // Print mode + claudeArgs.push('--output-format', 'stream-json'); // JSON streaming + claudeArgs.push('--verbose'); // Verbose output + console.log(chalk.cyan('🤖 Running in non-interactive mode')); + } - // Add auto-permission flag by default for hive-mind mode (unless explicitly disabled) + // Add auto-permission flag BEFORE the prompt if (flags['dangerously-skip-permissions'] !== false && !flags['no-auto-permissions']) { claudeArgs.push('--dangerously-skip-permissions'); if (!isNonInteractive) { @@ -2020,15 +2028,10 @@ async function spawnClaudeCodeInstances(swarmId, swarmName, objective, workers, } } - // Add non-interactive flags if needed - if (isNonInteractive) { - claudeArgs.push('-p'); // Print mode - claudeArgs.push('--output-format', 'stream-json'); // JSON streaming - claudeArgs.push('--verbose'); // Verbose output - console.log(chalk.cyan('🤖 Running in non-interactive mode')); - } + // Add the prompt as the LAST argument + claudeArgs.push(hiveMindPrompt); - // Spawn claude with the prompt as the first argument + // Spawn claude with properly ordered arguments const claudeProcess = childSpawn('claude', claudeArgs, { stdio: 'inherit', shell: false,