Skip to content

Slack mobile @ picker inserts bot_id (<@B…>) which Hermes ignores; duplicate identical Hermes rows #85835

Open

Description

@vesc-vesc

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

  1. Install Hermes Slack with the default manifest (assistant_view on) or with --no-assistant.
  2. Invite the bot to a public channel.
  3. On Slack iOS/Android, type @ and pick each of the two identical Hermes / app rows (do not type the handle by hand).
  4. 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_id the same as bot_user_id (<@B…> and Block Kit user.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-assistant reinstall

Related

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

  1. added
    type/bug
    P2
    comp/gateway
    platform/slack
    sweeper:risk-message-delivery
    on Aug 14, 2026
  2. szzhoujiarui commented on Aug 14, 2026

    @szzhoujiarui
    Contributor

    Implemented in #85885. The fix records the app bot ID from Slack auth.test, scopes it per workspace, and recognizes both U... and B... self-mentions while continuing to ignore other apps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2comp/gatewayplatform/slacksweeper:risk-message-deliverytype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions