hermes - 💡(How to fix) Fix [BUG] Telegram commands fail in groups with group_allowed_chats due to attribution prefix

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Output

Fix Action

workaround

Fix applied: Hotfix in gateway/platforms/telegram.py:

# Lines ~4775-4782
original_text = event.text
event = self._apply_telegram_group_observe_attribution(event)
event.text = original_text  # restore for is_command()

Code Example

# Gateway log when command is sent in problematic group:
msg='[Ivan|445135366] /status'
# Bot does not execute command, responds as regular message

# Gateway log in group without group_allowed_chats:
msg='/status'
# Command executes normally

---

# Lines ~4775-4782
original_text = event.text
event = self._apply_telegram_group_observe_attribution(event)
event.text = original_text  # restore for is_command()
RAW_BUFFERClick to expand / collapse

[BUG] Telegram commands fail in groups with group_allowed_chats due to attribution prefix

Bug Description

Telegram commands (e.g. /status, /compress, /new) fail to execute in groups with group_allowed_chats enabled, but work fine in groups without this setting. Bot receives the message but ignores the command — it gets processed as regular text instead.

Steps to Reproduce

  1. Add group chat_id to group_allowed_chats in config.yaml
  2. Configure require_mention: true and observe_unmentioned_group_messages: true
  3. Send /status command in the group (without @mention)
  4. Observe: message arrives at gateway but command is not executed — treated as regular text

Expected Behavior

Commands /status, /compress and others should execute in the group regardless of attribution prefix [Username|ID].

Actual Behavior

In groups with group_allowed_chats, the message text receives a [Ivan|445135366] prefix BEFORE is_command() check. The is_command() method checks text.startswith("/") — but the text now starts with [, not / → command not recognized → executed as regular message.

In groups WITHOUT group_allowed_chats the prefix is not added → commands work correctly.

Environment

  • OS: Linux (6.8.0-106-generic)
  • Hermes version: latest (2026-05-23)
  • Python version: 3.x
  • Platform: Telegram

Error Output

# Gateway log when command is sent in problematic group:
msg='[Ivan|445135366] /status'
# Bot does not execute command, responds as regular message

# Gateway log in group without group_allowed_chats:
msg='/status'
# Command executes normally

workaround

Fix applied: Hotfix in gateway/platforms/telegram.py:

# Lines ~4775-4782
original_text = event.text
event = self._apply_telegram_group_observe_attribution(event)
event.text = original_text  # restore for is_command()

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [BUG] Telegram commands fail in groups with group_allowed_chats due to attribution prefix