Skip to content

Slack channel mentions lose their entity type #1996

Closed

Description

@sentry-junior

When a user refers to a Slack channel in a message, Junior can receive only a plain-text #CHANNEL_ID instead of a typed channel reference. In one observed conversation, Junior treated that ID as a Sentry issue ID, searched for it, then recognized the mistake after the user clarified they had mentioned a Slack channel.

  • Slack’s message representation includes a channel mention as a typed rich-text element (type: channel, with channel_id) and text markup such as <#CHANNEL_ID>.
  • In Junior’s Slack ingress, slack-webhook.ts calls adapter.parseMessage(event). With @chat-adapter/[email protected], the synchronous parse path converts <#CHANNEL_ID> into plain #CHANNEL_ID; a local reproduction using a Slack-shaped event produced that exact output. It does not perform the name lookup used by a separate async parse path.
  • slack/message/content.ts uses the adapter’s formatted text for ordinary messages without section blocks, so the channel type is absent from the agent-visible text in this path.
  • In the observed incident, the Sentry lookup for the channel ID returned no match; after the user clarified, Junior correctly identified it as a Slack channel. The bot could read the channel, so channel access was not the blocker.
  • A separate report said a Sentry PR request returned an unrelated PR from the Junior repo. The prompt and trace for that case are unavailable, so whether it shares this cause is unknown.
  • The local parser reproduction used a constructed payload matching Slack’s rich-text format; the exact raw payload for the incident was not available. A later trace showed repeated Slack searches, but its contents are redacted, so it cannot establish whether that behavior was related.

Relevant code: packages/junior/src/chat/ingress/slack-webhook.ts, packages/junior/src/chat/slack/message/content.ts, and dependency @chat-adapter/[email protected]. This report is about the observed behavior and evidence; the underlying fix is not specified here.

via David Cramer.

--

View Junior Session [Sentry]

Activity

  1. MathurAditya724 commented on Oct 28, 2026

    @MathurAditya724
    Member

    Verified fixed on current main (0e8d2da9c7201f29c5fa122623e50dd4bdcded34) by PR #2108, merged October 13.

    parseContent preserves channel tokens from the raw Slack event instead of relying on the SDK text conversion that flattened them. The preserved forms include both <#CHANNEL_ID> and <#CHANNEL_ID|name>. See the content projection.

    Re-ran the existing regressions against the latest-main source: four test files, 22 tests passed. The message-content scenario passes an event through the real Slack adapter and checks that both forms remain typed channel tokens in parseContent(message).text.

    Closing the reported inbound channel-type loss as fixed. This is separate from formatting outgoing channel names as clickable mentions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions