Repository navigation
fix(slack): Keep Slack mentions typed and tell Junior its own user ID - #2108
Merged
Merged
Conversation
The Slack SDK flattens <@u123> to @u123 in inbound text, so the agent saw bare IDs it could not identify, including its own. It then echoed them, and replies posted through the markdown block showed the ID as literal text. Keep <@u123> and <#C123|name> tokens in agent-visible text, give the agent its Slack user ID in runtime context, and turn bare @u123 IDs in replies into real mentions. Refs #1996 Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 03d08e1. Configure here.
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38470392020. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
Sentry Evalsjunior-behavioral
Base commit junior-guardian
Base commit junior-integration
Base commit junior-router
Base commit |
Replace the regex repair of SDK-flattened mentions with a conversion that keeps <@U…> and <#C…> tokens out of the SDK mrkdwn conversion, so the agent gets the exact tokens Slack sent. Tighten the prompt and README text. Co-Authored-By: David Cramer <[email protected]>
Contributor
|
3 screenshot changes — 3 changed · 0 added · 0 removed Review screenshots in Frameshift
|
The behavioral evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38472891384. The evals of this commit replay them in strict mode. Eval-Suite: behavioral
The integration evals recorded these model responses in https://github.com/getsentry/junior/actions/runs/38472891356. The evals of this commit replay them in strict mode. Eval-Suite: integration
dcramer
approved these changes
Oct 13, 2026
sentry-junior Bot
added a commit
that referenced
this pull request
Oct 13, 2026
Main changed the system prompt in #2108, so these recordings no longer match. CI records them again for this branch. Co-Authored-By: David Cramer <[email protected]>
This branch was successfully deployed
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.

Junior thanked itself as
@U0AGGRG1V0Xin a public thread. A user wrote "a nice discussion with <@junior>", and Junior replied with "shout-out to @U0AGGRG1V0X". The reply showed the raw ID as plain text.Three separate gaps caused this, and the same gaps apply to every person and channel mention:
parseMessage, which flattens<@U123>to@U123and<#C123|name>to#name, with no name lookup. The agent sees a bare ID that it cannot classify. Slack tools return<@U123>, so the same person also shows up in two different forms. This is also the cause of Slack channel mentions lose their entity type #1996 (a channel ID taken for a Sentry issue ID).markdownblocks throughchat.postMessageand skip the SDK's bare-mention rewrite. So@U123in a reply shows up as literal text, but<@U123>renders correctly (other Junior replies confirm this).Changes:
parseContentrestores the<@U…>/<#C…|name>tokens from the raw event text. This is the one projection used for the current instruction, queued and steering messages, stored history, Briefs, and memory.slack.bot_user_id, and the identity section says that a mention of that ID refers to Junior.@U123/@W123user ID outside code into<@U123>.This also does the "delivery-time mention normalize" step that was planned in #1163 but never shipped. The new behavioral eval checks that Junior recognizes a mid-message mention of itself and does not repeat its ID.
Refs #1996
via David Cramer.
--
View Junior Session [Sentry]