Description
Bug Description
On Slack mobile, the @ mention picker can show two identical rows for a single Hermes install (same display name, both labeled as an app). One row inserts a real bot-user mention and Hermes replies. The other row inserts the app's bot_id (B…) as if it were a user mention. Slack does not treat <@B…> as a user mention, app_mention does not fire, and Hermes' channel mention gate stays closed — so the message looks like a no-op.
This is not two installed apps. users.list / auth.test show one bot user + one bot_id.
Default hermes slack manifest enables assistant_view, which makes Slack render extra Agent/AI surfaces. After applying --no-assistant and resetting mobile cache, the third (assistant) row went away, but the bot-user vs bot_id twin remained. Desktop Slack already collapsed the list and shows the dead row as raw @B0… text.
Other Hermes Slack operators on mobile will hit this: the default manifest is assistant-on, and the adapter only treats <@{bot_user_id}> as a mention.
Steps to Reproduce
- Install Hermes Slack with the default manifest (
assistant_viewon) or with--no-assistant. - Invite the bot to a public channel.
- On Slack iOS/Android, type
@and pick each of the two identical Hermes / app rows (do not type the handle by hand). - Compare the stored message via
conversations.history.
Live payload from a one-bot workspace (Hermes 0.20.0, 2026-08-14):
Working row (10 replies):
{"text": "<@U0BPYH3M4R0> ", "blocks": [{"type": "rich_text", "elements": [{"type": "rich_text_section", "elements": [{"type": "user", "user_id": "U0BPYH3M4R0"}]}]}]}Dead row (0 replies):
{"text": "<@B0BQSU11H40> ", "blocks": [{"type": "rich_text", "elements": [{"type": "rich_text_section", "elements": [{"type": "user", "user_id": "B0BQSU11H40"}]}]}]}B0BQSU11H40 is auth.test.bot_id / bots.info.id. U0BPYH3M4R0 is auth.test.user_id.
Expected Behavior
- Picking either identical mobile row should wake Hermes.
- Mention detection should treat the adapter's own
bot_idthe same asbot_user_id(<@B…>and Block Kituser.user_id = B…). - Ideally Slack mobile would not list the same app twice; that part is a Slack client bug. Hermes can still fail closed today when the client emits the B-id form.
Actual Behavior
is_mentioned only checks f"<@{bot_uid}>" (bot user id). _collect_slack_block_mentions will happily recover <@B0…> from the user element, but the gate still compares it to the U-id and drops the message. Slack's own formatter only treats @U / @W as user mentions (https://docs.slack.dev/messaging/formatting-message-text), and app_mention is documented against bot users (https://docs.slack.dev/reference/events/app_mention).
Desktop renders the dead row as literal @B0BQSU11H40 (not a mention chip). Mobile shows both rows as @Hermes.
Environment
- OS: macOS host / Slack mobile client
- Hermes: v0.20.0 (2026.8.3)
- Python: 3.11.15
- Slack: one workspace, one app, Socket Mode
- Manifest: first default (
assistant_view), then--no-assistantreinstall
Related
- Adapter mention gate:
plugins/platforms/slack/adapter.py(is_mentioned/_slack_mention_detection_text/_collect_slack_block_mentions) - Default assistant-on manifest: feat(slack): add --no-assistant flag to manifest generation #51416 / feat(slack): add --no-assistant flag to manifest generation #51487 (
--no-assistantis opt-in) - Nearby but different: [Bug]: Slack mention detection misses <@UID> written as a mrkdwn token in section/header/context blocks and in legacy attachments #75286 (mrkdwn
<@UID>in section/header/context blocks) — that issue is still U-id shaped - Slack agent surfaces: https://docs.slack.dev/ai/developing-agents
Proposed Fix
In the Slack adapter, treat the connection's own bot_id as a mention target alongside bot_user_id:
is_mentioned = bool(
(bot_uid and f"<@{bot_uid}>" in routing_text)
or (bot_id and f"<@{bot_id}>" in routing_text)
or self._slack_message_matches_mention_patterns(routing_text)
)Local workaround that already works: platforms.slack.mention_patterns: ["<@B0…>"] (requires gateway reload). That is per-install and should not be the product default.
Do not treat arbitrary B… ids as mentions — only this app's auth.test.bot_id.
Activity
szzhoujiarui commentedon Aug 14, 2026
Implemented in #85885. The fix records the app bot ID from Slack
auth.test, scopes it per workspace, and recognizes bothU...andB...self-mentions while continuing to ignore other apps.