From 065a6f3d1aff301ca4b9fa20efa74e18a2acee1f Mon Sep 17 00:00:00 2001 From: Jaco Bezuidenhout Date: Tue, 2 Jun 2026 06:31:43 +0000 Subject: [PATCH] fix: tighten OW background request filter to stop spurious task creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added three new detection patterns beyond the existing keyword checks: 1. Conversation history dumps: messages containing both "user:" and "assistant:" role markers — real user messages never have both 2. Context synthesis phrases: "provided context", "following conversation", "based on the conversation" (OW's query augmentation patterns) 3. Markdown template headers: "### " in messages >200 chars (OW uses section headers in background templates; real mobile messages don't) This closes the gap that caused "Fix CobraTrans ESET" to be created spuriously in Agent Ecosystem from an OW history-dump background request. Co-Authored-By: Claude Sonnet 4.6 --- app/intent.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/app/intent.py b/app/intent.py index 7dbb5fe..9e40060 100644 --- a/app/intent.py +++ b/app/intent.py @@ -64,14 +64,30 @@ def classify_intent(message: str) -> str: # 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. + + # Pattern 1: OW meta-task headers and keyword phrases 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): + "3-5 word title" in msg or + "provided context" in msg or + "following conversation" in msg or + "based on the conversation" in msg): + return "planning" + + # Pattern 2: conversation history dumps — contain role marker pairs. + # Real user messages never contain both "user:" and "assistant:" labels. + if "user:" in msg and "assistant:" in msg: + return "planning" + if msg.count("user:") >= 2 or msg.count("assistant:") >= 2: + return "planning" + + # Pattern 3: OW markdown template headers (### ) in long messages. + # Real mobile messages don't use markdown section headers. + if "### " in msg and len(msg) > 200: return "planning" # Project creation — check before task/query