checkpoint: File edit:

🚀 Generated with [Claude Code](https://claude.com/claude-code)
📊 V3 Development Progress Checkpoint

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
This commit is contained in:
rUvandClaude Sonnet 4 committed 2026-01-05 15:02:01 +00:00
1 parent e1ae74fc0c
commit 2a0089c247
1 file changed
+11 -6
+11 -6
View File
@@ -332,16 +332,21 @@ export class FederationHub extends EventEmitter {
clearInterval(this.cleanupInterval);
}
// Terminate all ephemeral agents
for (const agent of this.ephemeralAgents.values()) {
if (agent.status === 'active' || agent.status === 'spawning') {
await this.terminateAgent(agent.id);
}
}
// Terminate all active ephemeral agents using index - O(k) where k = active + spawning
const activeIds = this.getAgentIdsByStatus('active');
const spawningIds = this.getAgentIdsByStatus('spawning');
const toTerminate = [...activeIds, ...spawningIds];
await Promise.all(toTerminate.map(id => this.terminateAgent(id)));
// Clear all data structures and indexes
this.swarms.clear();
this.ephemeralAgents.clear();
this.proposals.clear();
this.agentsBySwarm.clear();
for (const status of this.agentsByStatus.values()) {
status.clear();
}
}
// ==========================================================================