mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-23 16:36:23 +00:00
Closes #52387 Slack messages can carry the bot @mention only inside Block Kit `blocks` (a `rich_text` section with a `user` element), with the flat top-level `text` containing just a fallback string. Both mention gates read only the flat `text`: - the `allow_bots: mentions` bot-message filter, and - the `is_mentioned` channel router (`routing_text = original_text`) so such messages were silently dropped — `allow_bots: mentions` was effectively non-functional for Block-Kit senders, and the same blind spot hit `require_mention` / `strict_mention`. Add `_collect_slack_block_mentions()` (walks blocks, recovers `<@UID>` tokens from non-quoted rich-text `user` elements) and `_slack_mention_detection_text()` (flat text + recovered mentions). Both gates now use the merged detection text. Mentions nested in `rich_text_quote` are deliberately ignored, preserving the existing contract that quoted/forwarded content can't trick the bot. Also emit a debug line when a bot message is dropped so silent drops are diagnosable. Tests: 4 new cases in tests/gateway/test_slack_mention.py (Block-Kit mention recovered, flat-text passthrough, no-mention, quoted-mention ignored). 275 slack tests pass. |
||
|---|---|---|
| .. | ||
| browser | ||
| context_engine | ||
| cron_providers | ||
| dashboard_auth | ||
| disk-cleanup | ||
| google_meet | ||
| hermes-achievements | ||
| image_gen | ||
| kanban | ||
| memory | ||
| model-providers | ||
| observability | ||
| platforms | ||
| security-guidance | ||
| spotify | ||
| teams_pipeline | ||
| video_gen | ||
| web | ||
| __init__.py | ||
| plugin_utils.py | ||