Improve task creation from thread context and add event deduplication #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR enhances the task extraction agent's ability to create tasks from thread context and adds event deduplication to prevent duplicate processing of Slack messages.
Key Changes
Task Creation from Thread Context
taskExtractor.ts: Added detailed guidance for "thread-reference task creation" where users reference previous messages (e.g., "add this task", "create a task for this"). The agent now correctly extracts task content from thread history rather than the user's current message.Event Deduplication
handleThreadReplyandhandleAssistantMessage: Both handlers now check if an event has already been processed before handling it, preventing duplicate task creation and responses.isEventProcessedandmarkEventProcessedqueries/mutations to track processed Slack events by timestamp.Context Formatting Improvements
## Tool parameters,## User message,## Thread context) for better agent comprehension.Conversation Flow Enhancements
handleThreadReplyto reuse active agent threads but create new ones if the conversation is inactive, improving continuity.getFallbackMessage()function for consistency across handlers.Implementation Details
eventTs) as the unique identifierhttps://claude.ai/code/session_01PoZNuRCfnFnfqK9cCAg6fD