From 96a50c5c3cc94d1ae6345a8cb547c20b4ad4c921 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 29 May 2026 11:32:37 +0800 Subject: [PATCH 1/2] fix(desktop): reduce group-channel task false positives --- .../TaskExtraction/TaskAssistantSettings.swift | 8 ++++++++ .../Desktop/Tests/TaskAssistantPromptTests.swift | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 desktop/Desktop/Tests/TaskAssistantPromptTests.swift diff --git a/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift b/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift index f9c24f0b72b..fc84b5f4bdc 100644 --- a/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift +++ b/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift @@ -170,6 +170,14 @@ class TaskAssistantSettings { - Questions expecting an answer: "What's the status of…?", "When will you…?" - Assigned items: "@user", "assigned to you", review requests + CRITICAL FOR PUBLIC/GROUP CHANNELS: + In Discord, Slack, Teams, community chats, and other public/group channels, extract ONLY when the visible evidence shows the user is directly involved: + - The message explicitly @mentions the user by name or handle + - It is a direct message (DM) thread, not a public or community channel + - The user has already replied in the same thread and is an active participant + If the user is merely observing a public channel, or if you cannot tell whether the request is directed at them, call no_task_found. + Do NOT extract tasks from broad bug reports, feature requests, or questions posted to the community at large. + WHO COUNTS AS "SOMEONE": - A coworker in Slack, Teams, Discord, email - A friend/family member in iMessage, WhatsApp, Telegram, Messenger diff --git a/desktop/Desktop/Tests/TaskAssistantPromptTests.swift b/desktop/Desktop/Tests/TaskAssistantPromptTests.swift new file mode 100644 index 00000000000..ddc2f70f4a9 --- /dev/null +++ b/desktop/Desktop/Tests/TaskAssistantPromptTests.swift @@ -0,0 +1,14 @@ +import XCTest +@testable import Omi_Computer + +final class TaskAssistantPromptTests: XCTestCase { + @MainActor + func testDefaultPromptSkipsPublicChannelRequestsNotDirectedAtUser() { + let prompt = TaskAssistantSettings.defaultAnalysisPrompt + + XCTAssertTrue(prompt.contains("CRITICAL FOR PUBLIC/GROUP CHANNELS")) + XCTAssertTrue(prompt.contains("visible evidence shows the user is directly involved")) + XCTAssertTrue(prompt.contains("call no_task_found")) + XCTAssertTrue(prompt.contains("questions posted to the community at large")) + } +} From 8f8c0992553d47d8fce61f9a721dd82e8f9534d9 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 29 May 2026 12:29:36 +0800 Subject: [PATCH 2/2] fix(desktop): clarify group-channel task prompt --- .../Assistants/TaskExtraction/TaskAssistantSettings.swift | 2 +- desktop/Desktop/Tests/TaskAssistantPromptTests.swift | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift b/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift index fc84b5f4bdc..c8ecca0fff4 100644 --- a/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift +++ b/desktop/Desktop/Sources/ProactiveAssistants/Assistants/TaskExtraction/TaskAssistantSettings.swift @@ -173,8 +173,8 @@ class TaskAssistantSettings { CRITICAL FOR PUBLIC/GROUP CHANNELS: In Discord, Slack, Teams, community chats, and other public/group channels, extract ONLY when the visible evidence shows the user is directly involved: - The message explicitly @mentions the user by name or handle - - It is a direct message (DM) thread, not a public or community channel - The user has already replied in the same thread and is an active participant + - The message is otherwise clearly addressed to the user by name, role, or visible thread context If the user is merely observing a public channel, or if you cannot tell whether the request is directed at them, call no_task_found. Do NOT extract tasks from broad bug reports, feature requests, or questions posted to the community at large. diff --git a/desktop/Desktop/Tests/TaskAssistantPromptTests.swift b/desktop/Desktop/Tests/TaskAssistantPromptTests.swift index ddc2f70f4a9..94e070ff5b4 100644 --- a/desktop/Desktop/Tests/TaskAssistantPromptTests.swift +++ b/desktop/Desktop/Tests/TaskAssistantPromptTests.swift @@ -8,7 +8,10 @@ final class TaskAssistantPromptTests: XCTestCase { XCTAssertTrue(prompt.contains("CRITICAL FOR PUBLIC/GROUP CHANNELS")) XCTAssertTrue(prompt.contains("visible evidence shows the user is directly involved")) - XCTAssertTrue(prompt.contains("call no_task_found")) + XCTAssertTrue(prompt.contains("merely observing a public channel")) + XCTAssertTrue(prompt.contains("cannot tell whether the request is directed at them")) + XCTAssertTrue(prompt.contains("otherwise clearly addressed to the user")) XCTAssertTrue(prompt.contains("questions posted to the community at large")) + XCTAssertFalse(prompt.contains("It is a direct message (DM) thread, not a public or community channel")) } }