fix: inline Slack block and attachment context - #11426
Conversation
- extract quote/list rich_text content into agent-visible text - inline redacted non-rich-text Block Kit payloads - surface link unfurl attachment previews without affecting routing - document and test Slack block/attachment visibility
|
Merged via #16213 — your commit was cherry-picked onto current main with your authorship preserved (9904f15). Thanks for the thorough work on the rich_text tree walk and the careful routing guard that keeps mention-gating / slash-command classification anchored to the original user text. One adjustment: dropped |
`_serialize_slack_blocks_for_agent()` inlines a redacted JSON view of the message's blocks so the agent can inspect structure it cannot otherwise read. NousResearch#11426 introduced it "for non-`rich_text` messages", but the guard bailed out only when *every* block was `rich_text`, so a single bot `section` alongside the user's own text dumped that text as well. `rich_text` is the authored message, already rendered into the message text by `_extract_text_from_slack_blocks()`. Repeating it is duplication on its own, and because the scalar allowlist drops `url` by design, the repeat arrives as the same sentence with every link deleted and a double space where the link used to be. Only non-`rich_text` blocks are serialized now; `section`, `actions` and accessory blocks are still described in full.
Summary
rich_textmessages so the agent can inspect the current message structurerich_textquotes/lists into readable text and surface link unfurl attachment previewsWhy
Slack blocks and attachment previews were present in the incoming payload but only stored in
raw_message, so the model could not inspect them. This made the agent blind to block-heavy alerts and other structured Slack content.Test Plan
Notes
This is effectively a bug fix for the Slack adapter's message normalization path: the gateway already received the structured payload, but the model-visible text dropped it.