Skip to content

add user_id to SlackMessageMetadata#288

Open
blinkagent[bot] wants to merge 1 commit intomainfrom
add-user-id-to-slack-metadata
Open

add user_id to SlackMessageMetadata#288
blinkagent[bot] wants to merge 1 commit intomainfrom
add-user-id-to-slack-metadata

Conversation

@blinkagent
Copy link
Contributor

@blinkagent blinkagent bot commented Mar 11, 2026

Adds user_id to SlackMessageMetadata so consumers can identify the Slack user who sent a message without parsing it from text parts.

Changes

  • packages/scout-agent/lib/types.ts — Added user_id: string to SlackMessageMetadata
  • packages/scout-agent/lib/slack.ts — Populates user_id from metadata.user?.id (the user info already fetched by createMessageFromEvent)

Motivation

Consumers like coder/agents need the sender's user ID to call users.info and check team_id for detecting external users (DMs from outside the workspace). Currently the user ID is only available embedded in message text parts as From 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.

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.
@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blink Ready Ready Preview, Comment Mar 11, 2026 3:02pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants