feat(agent): tell Slack-bound agent to echo labeled mention tokens#2676
Open
VojtechBartos wants to merge 1 commit into
Open
feat(agent): tell Slack-bound agent to echo labeled mention tokens#2676VojtechBartos wants to merge 1 commit into
VojtechBartos wants to merge 1 commit into
Conversation
Slack only renders `<@U_ID|displayname>` as a real ping; plain `@displayname` in agent output stays as text. The token arrives in the user's message context already labeled (the backend resolver enriches it before the agent sees it), so the agent just needs to copy it back verbatim.
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
2 tasks
Contributor
|
Reviews (1): Last reviewed commit: "feat(agent): tell Slack-bound agent to e..." | Re-trigger Greptile |
andrewm4894
approved these changes
Jun 15, 2026
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.
Problem
Slack only renders
<@U_ID|displayname>(or bare<@U_ID>) as a real ping. When the agent writes plain@displaynametext in its reply, Slack treats it as text — the user it's referring to doesn't get notified.The PostHog/posthog companion PR (PostHog/posthog#63495) makes the backend deliver Slack's labeled wire form
<@U_ID|displayname>in the message context the agent sees. This PR closes the loop on the agent side: tell it to copy that token verbatim into its reply.Changes
Add a one-paragraph instruction to the Slack-origin system prompt (next to the existing
# Response Stylesection):Only added when
getCloudInteractionOrigin() === "slack", so non-Slack interactions are unaffected.How did you test this?
Manual: end-to-end test from a Slack thread where the user
@-mentions someone. With backend PR + this prompt change in place, the agent's reply renders mentioned users as actual Slack pings. Without the prompt change, the agent tends to paraphrase to plain@nameand the ping is lost.No automated tests added — the change is in a string literal.
Automatic notifications