fix: swarm start now spawns real Claude processes#1265
Open
younes3334 wants to merge 1 commit intoruvnet:mainfrom
Open
fix: swarm start now spawns real Claude processes#1265younes3334 wants to merge 1 commit intoruvnet:mainfrom
younes3334 wants to merge 1 commit intoruvnet:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
swarm startwas showing a fake 500ms spinner without spawning any agents. Now it writes state files, generates per-role prompts, and launches a detached Node manager that runs up to 3 concurrentclaude --printprocessesswarm stopnow reads PIDs from.swarm/agents/*.jsonand kills them, auto-detects swarm ID from state fileagent_spawnMCP tool gains an optionalexecuteflag to spawn a real Claude process (default false, backward compatible)What was wrong
swarm startranawait new Promise(resolve => setTimeout(resolve, 500))then printed "deployed" — zero processes were ever started.swarm stopprinted fake messages without killing anything.How it works now
swarm startflattens the agent plan, writes agent/task/prompt files to.swarm/.swarm/.manager.js) picks up pending agents and spawnsclaude --print <prompt>with max 3 concurrentCLAUDECODEenv var to bypass nested-session guard.swarm/results/swarm statusreads real state from these filesswarm stopsends SIGTERM (or SIGKILL with--force) to tracked PIDsFiles changed
v3/@claude-flow/cli/src/commands/swarm.ts— start + stop commandsv3/@claude-flow/cli/src/mcp-tools/agent-tools.ts— execute flag in agent_spawnTesting
Tested on macOS with claude CLI installed. Verified agents spawn, PIDs are tracked, status reflects real state, and stop kills processes.
Fixes #1196, #1034, #984