Open
Conversation
Populate user_id from the Slack user info already fetched by createMessageFromEvent. This lets consumers (e.g. coder/agents) detect external users by comparing user team_id against the bot team_id without having to parse it from message text.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Adds
user_idtoSlackMessageMetadataso consumers can identify the Slack user who sent a message without parsing it from text parts.Changes
packages/scout-agent/lib/types.ts— Addeduser_id: stringtoSlackMessageMetadatapackages/scout-agent/lib/slack.ts— Populatesuser_idfrommetadata.user?.id(the user info already fetched bycreateMessageFromEvent)Motivation
Consumers like
coder/agentsneed the sender's user ID to callusers.infoand checkteam_idfor detecting external users (DMs from outside the workspace). Currently the user ID is only available embedded in message text parts asFrom User: ... (<@UXXXXXX>), which is fragile to parse. Having it as structured metadata makes external user detection reliable.See https://github.com/coder/agents/pull/50 for the consumer side.