diff --git a/app/intent.py b/app/intent.py index ddee9d4..275d6e1 100644 --- a/app/intent.py +++ b/app/intent.py @@ -61,6 +61,18 @@ def classify_intent(message: str) -> str: msg = message.lower() words = set(msg.split()) + # Open WebUI background tasks — sent automatically after every chat response. + # They include the full chat history, so they'd mis-trigger execute/task intents. + # Patterns: "### Task:", "Query: " (query augmentation), meta-task keywords. + if (msg.startswith("### task:") or + msg.startswith("query:") or + "chat history" in msg or + "summarizing the chat" in msg or + "categorizing the main themes" in msg or + "follow-up questions" in msg or + "3-5 word title" in msg): + return "planning" + # Project creation — check before task/query if any(p in msg for p in CREATE_PROJECT_PHRASES): return "create_project"