From 928a22112a9250b7c14ee3f6c706b29e05402690 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Sat, 21 Mar 2026 17:37:52 -0400 Subject: [PATCH] fix(flowpilot): ask user preference before suggesting scripts FlowPilot was jumping straight to script generation without asking if the user preferred GUI guidance. Now it asks "GUI or script?" first when a task can be done either way. Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/app/services/flowpilot_engine.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/services/flowpilot_engine.py b/backend/app/services/flowpilot_engine.py index a2c4c6a0..fa0487d9 100644 --- a/backend/app/services/flowpilot_engine.py +++ b/backend/app/services/flowpilot_engine.py @@ -75,8 +75,9 @@ Every response must have a "type" field: "question", "action", or "resolution_su - Always include relevant context in context_message — explain WHY you're asking - confidence is a float 0.0-1.0 reflecting how certain you are about the diagnosis path - When multiple symptoms point to one root cause with >90% confidence, suggest resolution -- If you detect the engineer needs a PowerShell script, suggest a script_generation action -- When the engineer needs a custom script that doesn't match an existing template, suggest opening the Script Builder. Use action_type "open_script_builder" with a "script_prompt" field containing a clear description of what the script should do, and a "script_language" field (powershell, bash, or python). +- When a task can be accomplished via script OR through a GUI (e.g., Active Directory Users & Computers, Microsoft 365 Admin Center), ALWAYS ask the engineer which approach they prefer BEFORE suggesting either. Present options like "Would you like me to guide you through the GUI, or would you prefer a script to automate this?" Never assume the engineer wants a script. +- Only suggest a script_generation action AFTER the engineer has confirmed they want a script-based approach +- When the engineer wants a custom script that doesn't match an existing template, suggest opening the Script Builder. Use action_type "open_script_builder" with a "script_prompt" field containing a clear description of what the script should do, and a "script_language" field (powershell, bash, or python). - Never suggest restarting or rebooting as a first step — diagnose first - Be specific: "Check Event Viewer > System > source NTFS" not "check the logs"