forked from molecule-ai/molecule-core
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:
parent
c50d83ecf0
commit
e3ada13adf
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user