🌊 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
TypeScript agentic-aiagentic-frameworkagentic-workflowagentsai-agentsai-assistantai-skillsautonomous-agentsclaudecodexdsh-pluginharnessmcp-servermulti-agentmulti-agent-systemsnpmskillsswarmswarm-intelligencetypescript
Checkpoint: File edits
rUvdf4d3073409a
diff --git a/v3/@claude-flow/cli/src/services/worker-queue.ts b/v3/@claude-flow/cli/src/services/worker-queue.tsindex 2305ef97c2..32faadf6d0 100644--- a/v3/@claude-flow/cli/src/services/worker-queue.ts+++ b/v3/@claude-flow/cli/src/services/worker-queue.ts@@ -578,34 +578,60 @@ export class WorkerQueue extends EventEmitter {*/async start(workerTypes: HeadlessWorkerType[],- handler: (task: QueueTask) => Promise<HeadlessExecutionResult>+ handler: (task: QueueTask) => Promise<HeadlessExecutionResult>,+ options?: { maxConcurrent?: number }): Promise<void> {- await this.registerWorker(workerTypes);+ await this.registerWorker(workerTypes, { maxConcurrent: options?.maxConcurrent });const processLoop = async () => {while (!this.isShuttingDown) {- const task = await this.dequeue(workerTypes);-- if (task) {- try {- const result = await handler(task);- await this.complete(task.id, result);- } catch (error) {- await this.fail(task.id, error instanceof Error ? error.message : String(error));+ try {+ // Respect concurrency limit+ if (this.processingTasks.size >= this.maxConcurrent) {+ await new Promise(resolve => setTimeout(resolve, 100));+ continue;+ }++ const task = await this.dequeue(workerTypes);++ if (task) {+ // Process task without blocking the loop (allows concurrency)+ this.processTask(task, handler).catch(error => {+ this.emit('error', { taskId: task.id, error: String(error) });+ });+ } else {+ // No task available, wait before polling again+ await new Promise(resolve => setTimeout(resolve, 1000));}- } else {- // No task available, wait before polling again- await new Promise(resolve => setTimeout(resolve, 1000));+ } catch (error) {+ this.emit('error', { error: error instanceof Error ? error.message : String(error) });+ // Wait before retrying to avoid tight error loop+ await new Promise(resolve => setTimeout(resolve, 5000));}}};// Start processingprocessLoop().catch(error => {- this.emit('error', { error: error.message });+ this.emit('error', { error: error instanceof Error ? error.message : String(error) });});}+ /**+ * Process a single task+ */+ private async processTask(+ task: QueueTask,+ handler: (task: QueueTask) => Promise<HeadlessExecutionResult>+ ): Promise<void> {+ try {+ const result = await handler(task);+ await this.complete(task.id, result);+ } catch (error) {+ await this.fail(task.id, error instanceof Error ? error.message : String(error));+ }+ }+/*** Shutdown the queue gracefully*/