From d5d5dfba876af0c7cc1a002c8e9212dfd11dba5f Mon Sep 17 00:00:00 2001 From: Reuven Date: Mon, 6 Apr 2026 21:12:51 -0400 Subject: [PATCH] fix: worker-detect crash on missing prompt parameter detectWorkerTriggers() crashed with 'Cannot read properties of undefined (reading slice)' when called without text. Added null guard at function entry. Co-Authored-By: claude-flow --- v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts index 2c50b182da..337123f931 100644 --- a/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts +++ b/v3/@claude-flow/cli/src/mcp-tools/hooks-tools.ts @@ -3211,6 +3211,8 @@ function detectWorkerTriggers(text: string): { confidence: number; context: string; } { + if (!text) return { detected: false, triggers: [], confidence: 0, context: '' }; + const detectedTriggers: WorkerTrigger[] = []; let totalMatches = 0;