fix(slack): use blocks API for mrkdwn rendering + restore Level 3

Slack's chat.postMessage renders the text field as plain text when
username override is used. Switching to blocks with type=mrkdwn
forces rich formatting (bold, links, code, dividers).

Also restores FetchWorkspaceChannelContext that was lost in rebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
rabbitblood 2026-04-17 14:47:07 -07:00
parent c50d83ecf0
commit e3ada13adf

View File

@ -89,6 +89,17 @@ func (s *SlackAdapter) sendBotMessage(ctx context.Context, config map[string]int
payload := map[string]interface{}{
"channel": channelID,
"text": chunk,
// Use blocks with mrkdwn type for rich formatting.
// The "text" field is the fallback for notifications/previews.
"blocks": []map[string]interface{}{
{
"type": "section",
"text": map[string]interface{}{
"type": "mrkdwn",
"text": chunk,
},
},
},
}
if username != "" {
payload["username"] = username