From 0f880daedda4bfc3dca857c29211a570e1e8b2a7 Mon Sep 17 00:00:00 2001 From: rUv Date: Thu, 8 Jan 2026 00:24:39 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-08T00:24:39Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../cli/src/services/worker-queue.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/v3/@claude-flow/cli/src/services/worker-queue.ts b/v3/@claude-flow/cli/src/services/worker-queue.ts index f009c0f050..1a6c42702e 100644 --- a/v3/@claude-flow/cli/src/services/worker-queue.ts +++ b/v3/@claude-flow/cli/src/services/worker-queue.ts @@ -312,8 +312,23 @@ export class WorkerQueue extends EventEmitter { timeoutMs?: number; } ): Promise { - const taskId = `task-${Date.now()}-${randomUUID().slice(0, 8)}`; + // Initialize if needed + if (!this.initialized) { + await this.initialize(); + } + + // Validate worker type + if (!workerType || typeof workerType !== 'string') { + throw new Error('Invalid worker type'); + } + + // Validate priority const priority = options?.priority || 'normal'; + if (!['critical', 'high', 'normal', 'low'].includes(priority)) { + throw new Error(`Invalid priority: ${priority}`); + } + + const taskId = `task-${Date.now()}-${randomUUID().slice(0, 8)}`; const task: QueueTask = { id: taskId,