fix(slack): resolve user mentions to display names#1409
Conversation
The Slack agent received raw user IDs (<@U0A4BLQB04B>) instead of human-readable names, making it unable to identify who was being mentioned. Resolves mentions via parallel users.info calls in thread context, channel history, and the prompt itself.
📝 WalkthroughWalkthroughThe changes introduce a new mention-resolution mechanism in the Slack integration. A new Changes
Sequence Diagram(s)sequenceDiagram
participant PM as process-mention
participant RAM as resolveUserMentions
participant SA as Slack API
participant RAN as runSlackAgent
PM->>RAM: Call with event.text
RAM->>RAM: Extract <@U...> patterns
RAM->>SA: Call users.info for each user ID
SA-->>RAM: Return user details
RAM->>RAM: Build ID→username mapping
RAM->>RAM: Create replacer function
RAM-->>PM: Return replacer function
PM->>PM: Apply replacer to text
PM->>RAN: Pass resolved text
RAN-->>PM: Process with agent
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
<@U0A4BLQB04B>) instead of human-readable names, so it couldn't identify who was being mentioned in threads or messagesresolveUserMentions()helper that collects unique<@U...>IDs and resolves them in parallel viaslack.users.info()Test plan
@Supersetand verify the agent identifies them by name@John Smith: message) instead of raw IDsSummary by CodeRabbit