From eed8116c66c0f1243f24ae001c091234a134e3e8 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sun, 5 Jul 2026 21:13:34 -0500 Subject: [PATCH] feat: support nlu_skip flag to exclude intermediate flows from NLU catalog Flows marked with nlu_skip:true are never offered to the NLU router, preventing the AI from jumping directly to steps that require prior data collection (e.g. submenu_mantenimiento_fecha needs grupo selected first). Co-Authored-By: Claude Sonnet 4.6 --- services/AiBot.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/AiBot.php b/services/AiBot.php index 51daa33..ba2da35 100644 --- a/services/AiBot.php +++ b/services/AiBot.php @@ -408,6 +408,9 @@ PROMPT; if ($isUpload && !in_array($permType, [1, 3], true)) continue; if ($isDownload && !in_array($permType, [2, 3], true)) continue; + // Flujos marcados como internos — no exponer al NLU + if (!empty($flow['nlu_skip'])) continue; + // Skip internal/navigation flows unless they have an explicit NLU description $hasNluDesc = isset($flow['nlu_description']) && $flow['nlu_description'] !== ''; if (in_array($type, ['text', 'image'], true) && !$isUpload && !$isDownload && !$hasNluDesc) continue;