Repository navigation
Fix Addie performance and add cache invalidation - #387
Merged
Merged
Conversation
The message handler was checking for bot messages via subtype, but Slack bot messages in DM threads include a bot_id field rather than setting subtype. Added bot_id check to prevent Addie from responding to messages from any bot, including herself. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Performance improvements to member context resolution: - Run 7 independent database/API queries in parallel instead of sequentially - Add 30-minute TTL cache for member context (invalidate on data changes) - Remove Addie interaction history lookup (Slack handles conversation context) - Export invalidateMemberContextCache for use when user data changes Expected improvement: ~2 seconds faster on first message, near-instant on follow-up messages from the same user within the cache window. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Invalidate the member context cache whenever user/organization data changes to ensure Addie always has fresh information. The 30-minute cache with these invalidation hooks maintains fast response times while keeping context current. Adds cache invalidation to: - Email preference changes (4 endpoints) - Subscription changes (Stripe webhooks) - Working group membership changes (4 endpoints) - Member profile changes (6 endpoints) - Slack account linking/unlinking (4 endpoints)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Fixes infinite loop bug in Addie responding to her own messages and significantly improves response latency by implementing a member context cache with targeted invalidation.
Key improvements:
bot_idfield (not justsubtype) in Slack DMsAddie now responds nearly instantly for most interactions (cached) and respects data changes immediately across working groups, profiles, subscriptions, and email preferences.