Fix swarm command non-interactive prompt injection

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 <noreply@anthropic.com>
This commit is contained in:
rUvandClaude committed 2025-08-12 15:04:17 +00:00
1 parent f4497facd4
commit e22c74dde5
5 files changed
+54 -4

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
{
"startTime": 1755010932318,
"startTime": 1755011056154,
"totalTasks": 1,
"successfulTasks": 1,
"failedTasks": 0,
+48
View File
@@ -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
}
]
+3 -3
View File
@@ -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": {}
}
]
+1
View File
@@ -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"}
+1
View File
@@ -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(-) "}