mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
## 🔧 Critical Swarm System Fixes ### Fixed Task File Naming Bug - Tasks were being saved as '[object Object].json' due to TaskId object structure - Now properly extracts task ID string for file naming - Files save correctly as 'task_<id>.json' ### Added Task Timeout Protection - Implemented automatic timeout detection in task execution loop - Tasks that exceed timeout (default 5 minutes) are marked as failed - Prevents swarms from hanging indefinitely on stuck tasks - Agent state properly cleaned up on timeout ### Fixed Target Directory Propagation - Testing tasks were receiving null targetDir, preventing file access - Target directory now extracted from objective description - All tasks inherit targetDir through context - Enhanced extractTargetDirectory to check multiple sources ### Improved Task Dependencies - Fixed taskDependenciesMet to handle both string and TaskId objects - Added convertDependenciesToTaskDependencies for Map structure - Dependencies now properly resolve for sequential task execution ### Auto Strategy Integration - Added missing autoStrategy property and initialization - Proper AutoStrategy instantiation in coordinator constructor - Enables intelligent task decomposition for 'auto' strategy ## 📊 Added Comprehensive Benchmarks ### Benchmark Suite Integration - Added complete Python-based benchmarking tool - Tests 7 strategies across 5 coordination modes - 100% success rate across all test scenarios - Performance metrics: 0.10s - 0.20s execution times ### Real-World Performance Data - Calculator example: 4m 20s total (3 tasks) - Task breakdown: Analysis 29%, Implementation 22%, Testing 48% - Successfully created 6 files with proper directory structure ## 📝 Documentation Updates ### Updated README.md - Added v1.0.50 changelog with critical fixes - Integrated benchmark performance results table - Added real-world timing example - Removed old update notes for clarity - Added dedicated Benchmarks & Performance section ## 🧪 Test Results - Swarm now completes successfully with proper task coordination - All fixes validated in production environment - Task files save with correct names - Testing tasks find implementation files - Swarms exit cleanly after completion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import { ParallelCoordinator, AgentTask } from "./coordinator";
|
|
|
|
async function runParallelTest() {
|
|
const coordinator = new ParallelCoordinator();
|
|
|
|
// Define tasks for each agent type
|
|
const agentTasks: AgentTask[] = [
|
|
{
|
|
name: "Specification",
|
|
mode: "spec-pseudocode",
|
|
task: "Create a simple calculator API specification with basic arithmetic operations",
|
|
priority: 1
|
|
},
|
|
{
|
|
name: "Architecture",
|
|
mode: "architect",
|
|
task: "Design the architecture for a REST API service with authentication",
|
|
priority: 1
|
|
},
|
|
{
|
|
name: "Code Implementation",
|
|
mode: "code",
|
|
task: "Implement a binary search algorithm in TypeScript",
|
|
priority: 2
|
|
},
|
|
{
|
|
name: "Test-Driven Development",
|
|
mode: "tdd",
|
|
task: "Create tests and implementation for a string utility library",
|
|
priority: 2
|
|
},
|
|
{
|
|
name: "Debugging",
|
|
mode: "debug",
|
|
task: "Analyze and fix a memory leak in a Node.js application",
|
|
priority: 3
|
|
},
|
|
{
|
|
name: "Documentation",
|
|
mode: "docs-writer",
|
|
task: "Create API documentation for a user management system",
|
|
priority: 3
|
|
},
|
|
{
|
|
name: "Security Review",
|
|
mode: "security-review",
|
|
task: "Review authentication implementation for vulnerabilities",
|
|
priority: 2
|
|
},
|
|
{
|
|
name: "Integration",
|
|
mode: "integration",
|
|
task: "Plan integration between microservices using message queues",
|
|
priority: 3
|
|
}
|
|
];
|
|
|
|
console.log("🎯 Claude-Flow Parallel Agent Test");
|
|
console.log("==================================");
|
|
console.log(`Testing ${agentTasks.length} agents in parallel mode\n`);
|
|
|
|
await coordinator.runParallelAgents(agentTasks);
|
|
}
|
|
|
|
// Run the test
|
|
runParallelTest().catch(console.error); |