diff --git a/extensions/slack/src/channel.test.ts b/extensions/slack/src/channel.test.ts index 538bc8c7d03..e01776210a3 100644 --- a/extensions/slack/src/channel.test.ts +++ b/extensions/slack/src/channel.test.ts @@ -1043,6 +1043,9 @@ describe("slackPlugin agentPrompt", () => { expect(hints).toContain( "- Slack plain text sends: write standard Markdown; OpenClaw converts it to Slack mrkdwn, including `**bold**`, headings, lists, and `[label](url)` links.", ); + expect(hints).toContain( + "- When mentioning Slack users, use the stable `<@USER_ID>` token from Slack context instead of plain `@name` text so Slack notifies and links the user.", + ); expect(hints).toContain( "- Slack Block Kit or presentation text fields are sent as Slack mrkdwn directly; use `*bold*`, `_italic_`, `~strike~`, `` links, and avoid Markdown headings or pipe tables there.", ); @@ -1073,6 +1076,9 @@ describe("slackPlugin agentPrompt", () => { expect(hints).toContain( "- Slack plain text sends: write standard Markdown; OpenClaw converts it to Slack mrkdwn, including `**bold**`, headings, lists, and `[label](url)` links.", ); + expect(hints).toContain( + "- When mentioning Slack users, use the stable `<@USER_ID>` token from Slack context instead of plain `@name` text so Slack notifies and links the user.", + ); expect(hints).toContain( "- Slack Block Kit or presentation text fields are sent as Slack mrkdwn directly; use `*bold*`, `_italic_`, `~strike~`, `` links, and avoid Markdown headings or pipe tables there.", ); diff --git a/extensions/slack/src/shared.ts b/extensions/slack/src/shared.ts index f62b13f4881..8d955427dd7 100644 --- a/extensions/slack/src/shared.ts +++ b/extensions/slack/src/shared.ts @@ -115,6 +115,7 @@ export function createSlackPluginBase(params: { ] ).concat([ "- Slack plain text sends: write standard Markdown; OpenClaw converts it to Slack mrkdwn, including `**bold**`, headings, lists, and `[label](url)` links.", + "- When mentioning Slack users, use the stable `<@USER_ID>` token from Slack context instead of plain `@name` text so Slack notifies and links the user.", "- Slack Block Kit or presentation text fields are sent as Slack mrkdwn directly; use `*bold*`, `_italic_`, `~strike~`, `` links, and avoid Markdown headings or pipe tables there.", ]), },