From 284fee15cafa6b2c385b5e9bc7362df2932128d3 Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 22 Feb 2026 01:00:48 +0000 Subject: [PATCH] [ci skip] Fix Slack message formatting to use Block Kit mrkdwn --- .claude/cluster-health.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.claude/cluster-health.sh b/.claude/cluster-health.sh index ea290e30..303f708e 100755 --- a/.claude/cluster-health.sh +++ b/.claude/cluster-health.sh @@ -371,12 +371,23 @@ if [[ "$SEND_SLACK" == true ]]; then fi fi - # Use python3 to JSON-escape the message body safely - json_payload=$(python3 -c " + # Use python3 to build Slack Block Kit payload with proper mrkdwn + json_payload=$(printf '%b' "$slack_text" | python3 -c " import json, sys -text = sys.stdin.read() -print(json.dumps({'text': text})) -" <<< "$slack_text") +text = sys.stdin.read().strip() +payload = { + 'blocks': [ + { + 'type': 'section', + 'text': { + 'type': 'mrkdwn', + 'text': text + } + } + ] +} +print(json.dumps(payload)) +") curl -s -X POST "$SLACK_WEBHOOK_URL" \ -H 'Content-Type: application/json' \