Skip to content

feat(gateway): configurable Telegram reply threading mode#2907

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-afb547e5
Mar 25, 2026
Merged

feat(gateway): configurable Telegram reply threading mode#2907
teknium1 merged 1 commit intomainfrom
hermes/hermes-afb547e5

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Adds a reply_to_mode setting to control whether Telegram replies quote/thread to the user's original message.

  • off: Never thread replies — no quote bubble shown
  • first: Only the first chunk threads to the user's message (default, preserves existing behavior)
  • all: All chunks in multi-part replies thread to the user's message

Configuration

Via gateway config YAML:

platforms:
  telegram:
    reply_to_mode: "off"  # or "first" (default) or "all"

Via environment variable:

TELEGRAM_REPLY_TO_MODE=off

Changes

  • gateway/config.py — Added reply_to_mode field to PlatformConfig with serialization and env var override
  • gateway/platforms/telegram.py — Added _should_thread_reply() method, updated send() to use it
  • tests/gateway/test_telegram_reply_mode.py — 25 tests covering all modes, config, serialization, and env var overrides

Credit

Based on PR #855 by @raulvidis. Cherry-picked and adapted to current main (preserved retry logic, used explicit @pytest.mark.asyncio decorators instead of global asyncio_mode change).

All 1428 gateway tests pass.

Add reply_to_mode setting (off/first/all) to control whether Telegram
replies quote/thread to the user's original message.

- 'off': Never thread replies (no quote bubble)
- 'first': Only first chunk threads to user's message (default, preserves existing behavior)
- 'all': All chunks in multi-part replies thread to user's message

Configurable via:
- reply_to_mode in platform config (gateway config YAML)
- TELEGRAM_REPLY_TO_MODE env var

Based on PR #855 by raulvidis.
@teknium1 teknium1 merged commit e5691ee into main Mar 25, 2026
2 checks passed
InB4DevOps pushed a commit to InB4DevOps/hermes-agent that referenced this pull request Mar 25, 2026
…ch#2907)

Add reply_to_mode setting (off/first/all) to control whether Telegram
replies quote/thread to the user's original message.

- 'off': Never thread replies (no quote bubble)
- 'first': Only first chunk threads to user's message (default, preserves existing behavior)
- 'all': All chunks in multi-part replies thread to user's message

Configurable via:
- reply_to_mode in platform config (gateway config YAML)
- TELEGRAM_REPLY_TO_MODE env var

Based on PR NousResearch#855 by raulvidis.
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…ch#2907)

Add reply_to_mode setting (off/first/all) to control whether Telegram
replies quote/thread to the user's original message.

- 'off': Never thread replies (no quote bubble)
- 'first': Only first chunk threads to user's message (default, preserves existing behavior)
- 'all': All chunks in multi-part replies thread to user's message

Configurable via:
- reply_to_mode in platform config (gateway config YAML)
- TELEGRAM_REPLY_TO_MODE env var

Based on PR NousResearch#855 by raulvidis.
StreamOfRon pushed a commit to StreamOfRon/hermes-agent that referenced this pull request Mar 29, 2026
…ch#2907)

Add reply_to_mode setting (off/first/all) to control whether Telegram
replies quote/thread to the user's original message.

- 'off': Never thread replies (no quote bubble)
- 'first': Only first chunk threads to user's message (default, preserves existing behavior)
- 'all': All chunks in multi-part replies thread to user's message

Configurable via:
- reply_to_mode in platform config (gateway config YAML)
- TELEGRAM_REPLY_TO_MODE env var

Based on PR NousResearch#855 by raulvidis.
aashizpoudel pushed a commit to aashizpoudel/hermes-agent that referenced this pull request Mar 30, 2026
…ch#2907)

Add reply_to_mode setting (off/first/all) to control whether Telegram
replies quote/thread to the user's original message.

- 'off': Never thread replies (no quote bubble)
- 'first': Only first chunk threads to user's message (default, preserves existing behavior)
- 'all': All chunks in multi-part replies thread to user's message

Configurable via:
- reply_to_mode in platform config (gateway config YAML)
- TELEGRAM_REPLY_TO_MODE env var

Based on PR NousResearch#855 by raulvidis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant