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 b323957 (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
- Set platforms.telegram.reply_to_mode: 'off' in config.yaml
- Create a DM topic (e.g. General, RUBIX, etc.)
- Send any message to the bot in that topic
- 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 b323957 (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
- Add reply_to_mode: Optional[str] = None kwarg to _reply_to_message_id_for_send() and _thread_kwargs_for_send()
- In _reply_to_message_id_for_send: return None when reply_to_mode == "off" and path is DM fallback
- In _thread_kwargs_for_send: return {"message_thread_id": ...} without reply anchor when reply_to_mode == "off"
- In send(): change to should_thread = reply_to_source is not None and self._reply_to_mode != "off"
- Thread reply_to_mode=self._reply_to_mode at all call sites (~29 total)
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 b323957 (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
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
Proposed Fix