hermes - 💡(How to fix) Fix reply_to_mode: 'off'ignored by Telegram DM topic reply fallback code [2 pull requests]

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…

Root Cause

Root Cause

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug Description

When platforms.telegram.reply_to_mode is set to "off" in config.yaml, the bot still quotes (replies to) the user's message on every response in Hermes-created DM topic lanes. The bot shows a quote bubble pointing to the user's triggering message despite explicit config requesting no quoting.

This was introduced in commit b3239572f (fix(telegram): preserve DM topic routing via reply fallback). The new DM topic reply fallback code hardcodes should_thread = True when telegram_dm_topic_reply_fallback metadata is present, completely bypassing the TelegramAdapter._should_thread_reply() method that is the single point which checks _reply_to_mode.

Root Cause

gateway/platforms/telegram.py send() (line ~1492):

if metadata and metadata.get("telegram_dm_topic_reply_fallback"): should_thread = reply_to_source is not None # ← ignores reply_to_mode else: should_thread = self._should_thread_reply(reply_to_source, i) # ← respects it

Additionally, _reply_to_message_id_for_send() and _thread_kwargs_for_send() unconditionally return the reply anchor for DM topic fallback sends — neither method accepts a reply_to_mode parameter, so all ~29 call sites propagate the ignore.

Expected Behavior

When reply_to_mode: "off" is set, no response message should include reply_to_message_id, regardless of whether the send uses DM topic routing, supergroup forum routing, or any other path.

Reproduction Steps

  1. Set platforms.telegram.reply_to_mode: 'off' in config.yaml
  2. Create a DM topic (e.g. General, RUBIX, etc.)
  3. Send any message to the bot in that topic
  4. Observe: the bot's reply shows a quote bubble pointing to your message

Affected Scenarios

reply_to_mode: 'off' in plain DM (no topics)

• Scenario: reply_to_mode: 'off' in plain DM (no topics)

• Works?: ✅ No quote

reply_to_mode: 'off' in DM topic lane

• Scenario: reply_to_mode: 'off' in DM topic lane

• Works?: ❌ Still quotes

reply_to_mode: 'first' in DM topic lane

• Scenario: reply_to_mode: 'first' in DM topic lane

• Works?: ✅ First reply only

reply_to_mode: 'all' in DM topic lane

• Scenario: reply_to_mode: 'all' in DM topic lane

• Works?: ✅ Every reply

Inline-approval buttons in DM topic lane

• Scenario: Inline-approval buttons in DM topic lane

• Works?: ❌ Still quote

Media sends in DM topic lane

• Scenario: Media sends in DM topic lane

• Works?: ❌ Still quote

Environment

  • Hermes Agent 0.13.0
  • Commit b3239572f (fix(telegram): preserve DM topic routing via reply fallback)
  • platforms.telegram.reply_to_mode: 'off'
  • Hermes-created DM topics (via extra.dm_topics)

Proposed Fix

  1. Add reply_to_mode: Optional[str] = None kwarg to _reply_to_message_id_for_send() and _thread_kwargs_for_send()
  2. In _reply_to_message_id_for_send: return None when reply_to_mode == "off" and path is DM fallback
  3. In _thread_kwargs_for_send: return {"message_thread_id": ...} without reply anchor when reply_to_mode == "off"
  4. In send(): change to should_thread = reply_to_source is not None and self._reply_to_mode != "off"
  5. Thread reply_to_mode=self._reply_to_mode at all call sites (~29 total)

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 reply_to_mode: 'off'ignored by Telegram DM topic reply fallback code [2 pull requests]