Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix(slack): use markdown_text parameter for proper Markdown rendering in V1 (#13869)

Vasco Schiavo8c2661638ea9
diff --git a/enterprise/integrations/slack/slack_v1_callback_processor.py b/enterprise/integrations/slack/slack_v1_callback_processor.py
index 3a3685a3b6..b9a93a61a3 100644
--- a/enterprise/integrations/slack/slack_v1_callback_processor.py
+++ b/enterprise/integrations/slack/slack_v1_callback_processor.py
@@ -111,9 +111,11 @@ class SlackV1CallbackProcessor(EventCallbackProcessor):
try:
# Post the summary as a threaded reply
+ # Use markdown_text instead of text to properly render standard Markdown
+ # (e.g., **bold**, [link](url)) which is used throughout the codebase
response = client.chat_postMessage(
channel=channel_id,
- text=summary,
+ markdown_text=summary,
thread_ts=thread_ts,
unfurl_links=False,
unfurl_media=False,
diff --git a/enterprise/tests/unit/integrations/slack/test_slack_v1_callback_processor.py b/enterprise/tests/unit/integrations/slack/test_slack_v1_callback_processor.py
index 209507c64b..e3baf86f12 100644
--- a/enterprise/tests/unit/integrations/slack/test_slack_v1_callback_processor.py
+++ b/enterprise/tests/unit/integrations/slack/test_slack_v1_callback_processor.py
@@ -257,7 +257,7 @@ class TestSlackV1CallbackProcessor:
# Verify Slack posting
mock_slack_client.chat_postMessage.assert_called_once_with(
channel='C1234567890',
- text='Test summary from agent',
+ markdown_text='Test summary from agent',
thread_ts='1234567890.123456',
unfurl_links=False,
unfurl_media=False,
@@ -509,7 +509,7 @@ class TestSlackV1CallbackProcessor:
# Verify user-friendly message was posted to Slack
mock_slack_client.chat_postMessage.assert_called_once()
call_kwargs = mock_slack_client.chat_postMessage.call_args[1]
- posted_message = call_kwargs.get('text', '')
+ posted_message = call_kwargs.get('markdown_text', '')
assert 'OpenHands encountered an error' in posted_message
assert 'LLM budget has been exceeded' in posted_message
assert 'please re-fill' in posted_message