hermes - 💡(How to fix) Fix Telegram: support per-group reply_to_mode to prevent multi-agent group wake loops

Official PRs (…)
ON THIS PAGE

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…

Please add per-chat / per-chat-type Telegram reply_to_mode control.

Current Hermes Telegram supports global TELEGRAM_REPLY_TO_MODE=off|first|all. That works as an emergency mitigation, but it is too coarse for multi-agent Telegram deployments.

Root Cause

Group replies must be disabled because they can become implicit agent wakeups, but private human-agent chats should still support replies for usability.

Fix Action

Fix / Workaround

Current Hermes Telegram supports global TELEGRAM_REPLY_TO_MODE=off|first|all. That works as an emergency mitigation, but it is too coarse for multi-agent Telegram deployments.

Current workaround

Code Example

Agent A @ Agent B
Agent B replies to Agent A's message
Agent A sees reply / mention context and responds
Agent B replies again
...

---

TELEGRAM_REPLY_TO_MODE=off

---

telegram:
  reply_to_mode: first
  groups:
    "-5198771458":
      reply_to_mode: off

---

TELEGRAM_REPLY_TO_MODE=first
TELEGRAM_GROUP_REPLY_TO_MODE_OFF_CHATS=-5198771458,-5066884201

---

1. A explicitly @mentions B to assign work.
2. B explicitly @mentions A when done or blocked.
3. A sends a plain acknowledgement without @mention and without reply.

---

TELEGRAM_REPLY_TO_MODE=off
RAW_BUFFERClick to expand / collapse

Summary

Please add per-chat / per-chat-type Telegram reply_to_mode control.

Current Hermes Telegram supports global TELEGRAM_REPLY_TO_MODE=off|first|all. That works as an emergency mitigation, but it is too coarse for multi-agent Telegram deployments.

Problem

In a Telegram group with multiple Hermes agents, one agent may explicitly @mention another agent to hand off work. However, Telegram replies also behave like an implicit wake signal/context anchor. If agents reply to each other's group messages, they can accidentally create a wake loop:

Agent A @ Agent B
Agent B replies to Agent A's message
Agent A sees reply / mention context and responds
Agent B replies again
...

This happened in a control-tower group used for CI/CD and agent coordination.

We can stop the loop with:

TELEGRAM_REPLY_TO_MODE=off

But this disables replies globally, including private chats. In private DM with humans, reply threading is useful and should remain enabled.

Desired behavior

Support disabling replies only in selected group chats, while preserving reply behavior in private chats.

Example desired config options, any equivalent design is fine:

telegram:
  reply_to_mode: first
  groups:
    "-5198771458":
      reply_to_mode: off

or env-style:

TELEGRAM_REPLY_TO_MODE=first
TELEGRAM_GROUP_REPLY_TO_MODE_OFF_CHATS=-5198771458,-5066884201

Expected semantics

  • Private DM: keep current default, e.g. reply_to_mode=first.
  • Selected Telegram groups: suppress reply_to_message_id on outgoing messages.
  • Other groups: use global/default reply_to_mode.
  • This should apply to normal text sends and media/document sends that currently pass reply_to_message_id.

Use case

Multi-agent control group protocol:

1. A explicitly @mentions B to assign work.
2. B explicitly @mentions A when done or blocked.
3. A sends a plain acknowledgement without @mention and without reply.

The group is a notification/control bus only. Real work continues in private DM sessions with the human owner.

Group replies must be disabled because they can become implicit agent wakeups, but private human-agent chats should still support replies for usability.

Current workaround

Set globally for each Hermes Telegram profile:

TELEGRAM_REPLY_TO_MODE=off

This prevents group reply loops, but sacrifices private-chat reply UX.

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 Telegram: support per-group reply_to_mode to prevent multi-agent group wake loops