openclaw - 💡(How to fix) Fix Slack markdown conversion bypassed when blocks parameter is present in message tool [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#55460Fetched 2026-04-08 01:39:16
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Root Cause

In extensions/slack/src/send.ts, sendMessageSlack() has two code paths:

  1. When blocks exist (line 281-295): Sends blocks directly, text is only used as fallback — no markdown conversion
  2. When no blocks (line 298+): Runs markdownToSlackMrkdwnChunks() to convert **bold***bold*

Since the message tool schema requires blocks, path 1 always executes.

Code Example

message(action=send, channel=slack, target=C0AKKLWGNG4, message='**this should be bold**', blocks=[{"type": "section", "text": {"type": "mrkdwn", "text": "x"}}])
RAW_BUFFERClick to expand / collapse

Bug

When using the message(action=send) tool to send Slack messages, the markdown-to-mrkdwn converter (markdownToSlackMrkdwnChunks) is bypassed if the blocks parameter is present in the request.

Since blocks is a required parameter in the message tool schema, LLMs always include it — meaning the converter never runs for message tool sends.

Impact

All messages sent via message(action=send) on Slack show raw markdown formatting:

  • **bold** shows as literal **bold** instead of bold text
  • ~~strikethrough~~ shows as literal tildes
  • Markdown headings (## Heading) render as plain text

Root Cause

In extensions/slack/src/send.ts, sendMessageSlack() has two code paths:

  1. When blocks exist (line 281-295): Sends blocks directly, text is only used as fallback — no markdown conversion
  2. When no blocks (line 298+): Runs markdownToSlackMrkdwnChunks() to convert **bold***bold*

Since the message tool schema requires blocks, path 1 always executes.

Suggested Fix

Either:

  1. Remove blocks from required params in the message tool schema (make it optional)
  2. In sendMessageSlack, normalize the fallback text through markdownToSlackMrkdwn() even when blocks are present
  3. When blocks contain mrkdwn text fields, run the converter on those fields too

Option 1 is the simplest.

Reproduction

message(action=send, channel=slack, target=C0AKKLWGNG4, message='**this should be bold**', blocks=[{"type": "section", "text": {"type": "mrkdwn", "text": "x"}}])

The message renders with literal ** asterisks in Slack instead of bold formatting.

Environment

  • OpenClaw v2026.3.22-beta.1
  • All agent accounts affected (kaleidoscope, sage, nova, etc.)

extent analysis

Fix Plan

To fix the issue, we will implement the suggested fix by normalizing the fallback text through markdownToSlackMrkdwn() even when blocks are present.

Here are the steps:

  • Open the extensions/slack/src/send.ts file
  • Locate the sendMessageSlack() function
  • Modify the code path when blocks exist to run markdownToSlackMrkdwnChunks() on the text field
  • Additionally, run the converter on mrkdwn text fields in blocks

Example code changes:

// In sendMessageSlack() when blocks exist
if (blocks) {
  // ... existing code ...
  const text = markdownToSlackMrkdwnChunks(originalText);
  // ... existing code ...
  
  // Run converter on mrkdwn text fields in blocks
  blocks.forEach(block => {
    if (block.text && block.text.type === 'mrkdwn') {
      block.text.text = markdownToSlackMrkdwnChunks(block.text.text);
    }
  });
}

Verification

To verify the fix, send a message using the message(action=send) tool with markdown formatting and check if it renders correctly in Slack.

Example test command:

message(action=send, channel=slack, target=C0AKKLWGNG4, message='**this should be bold**', blocks=[{"type": "section", "text": {"type": "mrkdwn", "text": "**bold text**"}}])

If the fix is successful, the message should render with bold formatting instead of literal ** asterisks.

Extra Tips

  • Make sure to test the fix with different types of markdown formatting to ensure it works correctly.
  • Consider adding unit tests to cover this functionality and prevent regressions in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING