From e22c74dde565c8d15d74b28a4b4fdc9ee2f5d89b Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 12 Aug 2025 15:04:17 +0000 Subject: [PATCH] Fix swarm command non-interactive prompt injection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to hive-mind fix, the swarm command had incorrect argument ordering for non-interactive mode. Problems fixed: 1. Regular swarm flow: Arguments were [prompt, -p, --output-format, --verbose] - Now correctly ordered as: [-p, --output-format, --verbose, prompt] 2. --claude flag flow: Arguments were [prompt, --dangerously-skip-permissions] - Now correctly ordered as: [--dangerously-skip-permissions, prompt] This ensures proper prompt injection in both interactive and non-interactive modes for the swarm command, matching the fix applied to hive-mind. The key principle: In non-interactive mode, all flags must come before the prompt argument for Claude Code to properly process them. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 48 ++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +-- .claude/checkpoints/1755011011.json | 1 + .claude/checkpoints/1755011012.json | 1 + 5 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 .claude/checkpoints/1755011011.json create mode 100644 .claude/checkpoints/1755011012.json diff --git a/.claude-flow/metrics/performance.json b/.claude-flow/metrics/performance.json index b700c73be8..f5673d3d2c 100644 --- a/.claude-flow/metrics/performance.json +++ b/.claude-flow/metrics/performance.json @@ -1,5 +1,5 @@ { - "startTime": 1755010932318, + "startTime": 1755011056154, "totalTasks": 1, "successfulTasks": 1, "failedTasks": 0, diff --git a/.claude-flow/metrics/system-metrics.json b/.claude-flow/metrics/system-metrics.json index 2d934b06ae..34594ba26b 100644 --- a/.claude-flow/metrics/system-metrics.json +++ b/.claude-flow/metrics/system-metrics.json @@ -1162,5 +1162,53 @@ "cpuLoad": 0.0675, "platform": "linux", "uptime": 4100.14 + }, + { + "timestamp": 1755010945564, + "memoryTotal": 67427540992, + "memoryUsed": 5898256384, + "memoryFree": 61529284608, + "memoryUsagePercent": 8.74754780794958, + "memoryEfficiency": 91.25245219205041, + "cpuCount": 16, + "cpuLoad": 0.0675, + "platform": "linux", + "uptime": 4130.14 + }, + { + "timestamp": 1755010975595, + "memoryTotal": 67427540992, + "memoryUsed": 6111129600, + "memoryFree": 61316411392, + "memoryUsagePercent": 9.063254435935992, + "memoryEfficiency": 90.93674556406401, + "cpuCount": 16, + "cpuLoad": 0.0475, + "platform": "linux", + "uptime": 4160.17 + }, + { + "timestamp": 1755011005600, + "memoryTotal": 67427540992, + "memoryUsed": 5996883968, + "memoryFree": 61430657024, + "memoryUsagePercent": 8.893819765296655, + "memoryEfficiency": 91.10618023470334, + "cpuCount": 16, + "cpuLoad": 0.0475, + "platform": "linux", + "uptime": 4190.18 + }, + { + "timestamp": 1755011035630, + "memoryTotal": 67427540992, + "memoryUsed": 6151835648, + "memoryFree": 61275705344, + "memoryUsagePercent": 9.123624497488185, + "memoryEfficiency": 90.87637550251182, + "cpuCount": 16, + "cpuLoad": 0.058125, + "platform": "linux", + "uptime": 4220.21 } ] \ No newline at end of file diff --git a/.claude-flow/metrics/task-metrics.json b/.claude-flow/metrics/task-metrics.json index f859ba86fa..c84532d97e 100644 --- a/.claude-flow/metrics/task-metrics.json +++ b/.claude-flow/metrics/task-metrics.json @@ -1,10 +1,10 @@ [ { - "id": "cmd-hooks-1755010932421", + "id": "cmd-hooks-1755011056258", "type": "hooks", "success": true, - "duration": 26.87765999999999, - "timestamp": 1755010932449, + "duration": 6.9438539999999875, + "timestamp": 1755011056265, "metadata": {} } ] \ No newline at end of file diff --git a/.claude/checkpoints/1755011011.json b/.claude/checkpoints/1755011011.json new file mode 100644 index 0000000000..2020ea816b --- /dev/null +++ b/.claude/checkpoints/1755011011.json @@ -0,0 +1 @@ +{"branch": "checkpoint/pre-edit-20250812-150331", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/swarm.js", "timestamp": "2025-08-12T15:03:31Z", "type": "pre-edit", "original_branch": "alpha-89"} diff --git a/.claude/checkpoints/1755011012.json b/.claude/checkpoints/1755011012.json new file mode 100644 index 0000000000..15276b092b --- /dev/null +++ b/.claude/checkpoints/1755011012.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250812-150332", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/swarm.js", "timestamp": "2025-08-12T15:03:32Z", "type": "post-edit", "branch": "alpha-89", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 36 ++++++++++++++++++++++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/1755010995.json | 1 + .claude/checkpoints/1755010997.json | 1 + src/cli/simple-commands/swarm.js | 11 ++++++---- 6 files changed, 49 insertions(+), 8 deletions(-) "}