fix: resolve Slack user mentions and display leader names correctly#654
Merged
Conversation
This PR addresses an issue where committee leaders were showing as Slack user IDs (like U0A1RAMRWNS) instead of their names. Changes: - Add LEFT JOIN to slack_user_mappings in getLeaders/getLeadersBatch to look up names for leaders stored with Slack user IDs - Add resolveSlackMentions() to convert <@u123> to <@u123|Name> before sending to LLM, so Claude/Addie can correctly identify mentioned users - Update add/remove_committee_leader handlers to auto-resolve Slack IDs to WorkOS IDs when possible - Use more robust Slack ID pattern matching (/^U[A-Z0-9]{8,}$/) - Escape $ characters in names during replacement to prevent issues 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
Changes
SQL query fix (
working-group-db.ts): Added LEFT JOIN toslack_user_mappingsingetLeaders()andgetLeadersBatch()so leaders stored with Slack IDs can have their names displayed correctlyMention resolution (
security.ts,handler.ts): AddedresolveSlackMentions()function that converts<@U123>to<@U123|Name>before sending to Claude, preventing user confusion in the LLMAdmin tools fix (
admin-tools.ts):add_committee_leaderandremove_committee_leadernow auto-detect Slack user IDs and resolve them to WorkOS IDs when possibleTest plan
🤖 Generated with Claude Code