# NousResearch/hermes-agent · Telegram slash commands and require_mention in group chats

## Open now

- Nothing open on GitHub.

The members concern Telegram slash commands apparently bypassing the require_mention setting in groups, reportedly leading to duplicate responses when multiple bots are present. One item reports the problem, and the other two are pull requests that propose making slash commands respect require_mention; one of them is described as a salvage of #6036.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #13438. Verify it addresses your case.
- **Recommended:** read PR #13438 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-13438`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #6033: Telegram: slash commands bypass require_mention causing duplicate responses in multi-bot groups

## Prior & competing PRs

- **#13438: fix(telegram): slash commands respect require_mention in groups (salvage of #6036)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `gateway/platforms/telegram.py`, `scripts/release.py`, `tests/gateway/test_telegram_group_gating.py`
  - fix hunks:
  - `gateway/platforms/telegram.py`

    ```diff
    @@ -2333,10 +2333,16 @@ def _should_process_message(self, message: Message, *, is_command: bool = False)
             DMs remain unrestricted. Group/supergroup messages are accepted when:
             - the chat is explicitly allowlisted in ``free_response_chats``
             - ``require_mention`` is disabled
    -        - the message is a command
             - the message replies to the bot
             - the bot is @mentioned
             - the text/caption matches a configured regex wake-word pattern
    +
    +        When ``require_mention`` is enabled, slash commands are not given
    +        special treatment — they must pass the same mention/reply checks
    +        as any other group message.  Users can still trigger commands via
    +        the Telegram bot menu (``/command@botname``) or by explicitly
    +        mentioning the bot (``@botname /command``), both of which are
    +        recognised as mentions by :meth:`_message_mentions_bot`.
             """
             if not self._is_group_chat(message):
                 return True
    ```

    ```diff
    @@ -2351,8 +2357,6 @@ def _should_process_message(self, message: Message, *, is_command: bool = False)
                 return True
             if not self._telegram_require_mention():
                 return True
    -        if is_command:
    -            return True
             if self._is_reply_to_bot(message):
                 return True
             if self._message_mentions_bot(message):
    ```
  - `scripts/release.py`

    ```diff
    @@ -326,6 +326,7 @@
         "aniruddhaadak80@users.noreply.github.com": "aniruddhaadak80",
         "[redacted:email]": "jerilynzheng",
         "[redacted:email]": "Aslaaen",
    +    "[redacted:email]": "pinion05",
     }
     
     
    ```
  - `tests/gateway/test_telegram_group_gating.py`

    ```diff
    @@ -71,7 +71,17 @@ def test_group_messages_can_require_direct_trigger_via_config():
         assert adapter._should_process_message(_group_message("hello everyone")) is False
         assert adapter._should_process_message(_group_message("hi @hermes_bot", entities=[_mention_entity("hi @hermes_bot")])) is True
         assert adapter._should_process_message(_group_message("replying", reply_to_bot=True)) is True
    -    assert adapter._should_process_message(_group_message("/status"), is_command=True) is True
    +    # Commands must also respect require_mention when it is enabled
    +    assert adapter._should_process_message(_group_message("/status"), is_command=True) is False
    +    # But commands with @mention still pass (Telegram emits a MENTION entity
    +    # for /cmd@botname — the bot menu and python-telegram-bot's CommandHandler
    +    # rely on this same mechanism)
    +    assert adapter._should_process_message(
    +        _group_message("/status@hermes_bot", entities=[_mention_entity("/status@hermes_bot")])
    +    ) is True
    +    # And commands still pass unconditionally when require_mention is disabled
    +    adapter_no_mention = _make_adapter(require_mention=False)
    +    assert adapter_no_mention._should_process_message(_group_message("/status"), is_command=True) is True
     
     
     def test_free_response_chats_bypass_mention_requirement():
    ```
- **#6036: fix: slash commands now respect require_mention in Telegram groups**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`

## Fix status

- Merged to main in PR #13438 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-04-21`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
