From 98543edd3d6e5c5bd3c09456ebd36fbdf78bc9cd Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 10 May 2026 14:33:00 +0100 Subject: [PATCH] fix(slack): clarify formatting hints --- CHANGELOG.md | 1 + extensions/slack/src/channel.test.ts | 16 ++++++++++++++-- extensions/slack/src/shared.ts | 8 ++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b86ed9742f4..85c4d030694 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Docs: https://docs.openclaw.ai - Slack: pass configured agent identity through draft preview sends so partial streaming replies keep custom username/avatar on the initial Slack message. Fixes #38235. (#38237) Thanks @lacymorrow. - Slack: support `allowBots: "mentions"` for bot-authored messages that mention the receiving bot, matching the documented Discord-style mode without accepting every bot message. Fixes #43587. (#43588) Thanks @raw34. - Slack: refresh private file URLs with `files.info` when inbound DM file events omit or stale attachment URLs, preventing file attachments from being dropped before media hydration. Fixes #50129. (#50200) Thanks @smartchainark. +- Slack: add scoped message-tool formatting hints so agents use Markdown for plain sends and direct mrkdwn for Block Kit fields. Fixes #34609. (#50979) Thanks @carrotRakko. - Gateway/agents: keep structured reasons when active-run queueing fails and deprecate the legacy boolean queue helper, so steering and subagent wake diagnostics distinguish completed, non-streaming, and compacting runs. Fixes #80156. Thanks @markus-lassfolk. - Agents/UI: compact exec and tool progress rows by hiding redundant shell tool names, replacing known workspace paths with short context markers, and preserving Discord trace scrubbing for compact command lines. - ACPX: run and await the embedded ACP backend startup probe by default so the gateway `ready` signal no longer fires before the acpx runtime has either become usable or reported a probe failure; set `OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE=0` to restore lazy startup. Fixes #79596. Thanks @bzelones. diff --git a/extensions/slack/src/channel.test.ts b/extensions/slack/src/channel.test.ts index fa64ebf44c1..0f788f3b0d4 100644 --- a/extensions/slack/src/channel.test.ts +++ b/extensions/slack/src/channel.test.ts @@ -809,9 +809,15 @@ describe("slackPlugin agentPrompt", () => { }, }); - expect(hints).toEqual([ + expect(hints).toContain( "- Slack interactive replies are disabled. If needed, ask to set `channels.slack.capabilities.interactiveReplies=true` (or the same under `channels.slack.accounts..capabilities`).", - ]); + ); + 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( + "- 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.", + ); }); it("shows Slack interactive reply directives when enabled", () => { @@ -836,6 +842,12 @@ describe("slackPlugin agentPrompt", () => { expect(hints).toContain( "- Slack selects: use `[[slack_select: Placeholder | Label:value, Other:other]]` to add a static select menu that routes the chosen value back as a Slack interaction system event.", ); + 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( + "- 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 86d95e9e605..f62b13f4881 100644 --- a/extensions/slack/src/shared.ts +++ b/extensions/slack/src/shared.ts @@ -104,7 +104,7 @@ export function createSlackPluginBase(params: { ], }), messageToolHints: ({ cfg, accountId }) => - isSlackInteractiveRepliesEnabled({ cfg, accountId }) + (isSlackInteractiveRepliesEnabled({ cfg, accountId }) ? [ "- Prefer Slack buttons/selects for 2-5 discrete choices or parameter picks instead of asking the user to type one.", "- Slack interactive replies: use `[[slack_buttons: Label:value, Other:other]]` to add action buttons that route clicks back as Slack interaction system events.", @@ -112,7 +112,11 @@ export function createSlackPluginBase(params: { ] : [ "- Slack interactive replies are disabled. If needed, ask to set `channels.slack.capabilities.interactiveReplies=true` (or the same under `channels.slack.accounts..capabilities`).", - ], + ] + ).concat([ + "- Slack plain text sends: write standard Markdown; OpenClaw converts it to Slack mrkdwn, including `**bold**`, headings, lists, and `[label](url)` links.", + "- 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.", + ]), }, streaming: { blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },