Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

checkpoint: File edit:

rUv2ecdfe33da3c
diff --git a/v3/@claude-flow/swarm/src/federation-hub.ts b/v3/@claude-flow/swarm/src/federation-hub.ts
index eda7742807..0d88c17c14 100644
--- a/v3/@claude-flow/swarm/src/federation-hub.ts
+++ b/v3/@claude-flow/swarm/src/federation-hub.ts
@@ -373,11 +373,10 @@ export class FederationHub extends EventEmitter {
unregisterSwarm(swarmId: SwarmId): boolean {
const removed = this.swarms.delete(swarmId);
if (removed) {
- // Terminate all ephemeral agents in this swarm
- for (const agent of this.ephemeralAgents.values()) {
- if (agent.swarmId === swarmId) {
- this.terminateAgent(agent.id);
- }
+ // Terminate all ephemeral agents in this swarm using index - O(k)
+ const agentIds = this.getAgentIdsBySwarm(swarmId);
+ for (const agentId of agentIds) {
+ this.terminateAgent(agentId);
}
this.emitEvent('swarm_left', swarmId);
}