Skip to content

fix: make swarm_status return actual agent counts from agent store#1064

Open
sbhavani wants to merge 1 commit intoruvnet:mainfrom
sbhavani:main
Open

fix: make swarm_status return actual agent counts from agent store#1064
sbhavani wants to merge 1 commit intoruvnet:mainfrom
sbhavani:main

Conversation

@sbhavani
Copy link

@sbhavani sbhavani commented Feb 1, 2026

Summary

Previously swarm_status returned hardcoded zeros for agent counts, making it useless for monitoring swarm state.

This fix reads from .claude-flow/agents/store.json (the same persistence layer used by agent_spawn) to return actual agent counts.

Changes

  • Added loadSwarmAgents() function that reads agent store JSON
  • Updated swarm_status handler to return real counts: total, active, idle, busy, terminated
  • Swarm status is now 'running' when agents exist, 'idle' when empty

Before

{ "swarmId": "...", "status": "running", "agentCount": 0, "taskCount": 0 }

After

{
  "swarmId": "default",
  "status": "running",
  "agentCount": 1,
  "agents": { "total": 1, "active": 1, "idle": 1, "busy": 0, "terminated": 0 },
  "topology": "hierarchical-mesh"
}

🤖 Generated with claude-flow

Previously swarm_status returned hardcoded zeros for agent counts.
Now it reads from .claude-flow/agents/store.json to return real counts.

Co-Authored-By: claude-flow <ruv@ruv.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant