Repository navigation
Closed
Description
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, withchannel_id) and text markup such as<#CHANNEL_ID>. - In Junior’s Slack ingress,
slack-webhook.tscallsadapter.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.tsuses 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.
--
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(slack): Keep Slack mentions typed and tell Junior its own user ID (…
MathurAditya724 commentedon Oct 28, 2026
Verified fixed on current
main(0e8d2da9c7201f29c5fa122623e50dd4bdcded34) by PR #2108, merged October 13.parseContentpreserves 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.