Skip to content

fix(gateway): load reply_to_mode from config.yaml for Discord and Telegram#17117

Closed
ashermorse wants to merge 1 commit into
NousResearch:mainfrom
ashermorse:fix/reply-to-mode-yaml-bridge
Closed

fix(gateway): load reply_to_mode from config.yaml for Discord and Telegram#17117
ashermorse wants to merge 1 commit into
NousResearch:mainfrom
ashermorse:fix/reply-to-mode-yaml-bridge

Conversation

@ashermorse
Copy link
Copy Markdown
Contributor

What does this PR do?

discord.reply_to_mode and telegram.reply_to_mode in config.yaml are silently ignored — the YAML-to-env-var bridge maps every sibling key but this one was missed.

Re-submission of the fix from #9837 (@Hypn0sis, Discord-only, went stale) and #13930 (@ishardo, Discord + Telegram, auto-closed when author deleted their fork). Both are credited as co-authors. The code is theirs; this PR just re-applies it since neither landed.

Changes Made

  • gateway/config.py: add reply_to_mode YAML-to-env-var bridge in both Discord and Telegram config blocks
  • tests/gateway/test_discord_reply_mode.py: 5 new tests (TestYamlConfigLoading)
  • tests/gateway/test_telegram_reply_mode.py: 5 new tests (TestTelegramYamlConfigLoading)

How to Test

pytest tests/gateway/test_discord_reply_mode.py tests/gateway/test_telegram_reply_mode.py -v — 63 pass (53 existing + 10 new).

Tested on macOS 15 (Darwin 25.2.0).

…egram

The YAML-to-env-var bridge in load_gateway_config() mapped every Discord
and Telegram config key (require_mention, auto_thread, reactions, etc.)
except reply_to_mode. Users setting discord.reply_to_mode or
telegram.reply_to_mode in ~/.hermes/config.yaml got no effect — the
adapter only read the env var, which nothing populated from YAML.

Add the missing bridge for both platforms, following the existing pattern.
Top-level <platform>.reply_to_mode preferred, falls back to
<platform>.extra.reply_to_mode, env var never overwritten. Handles YAML
1.1 bare `off` → Python False coercion.

This is a re-submission of the work from #9837 and #13930, which both
implemented the same fix but neither landed (see co-authors below).

Co-authored-by: Matteo De Agazio <hypnosis.mda@gmail.com>
Co-authored-by: ishardo <239075732+ishardo@users.noreply.github.com>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles platform/discord Discord bot adapter platform/telegram Telegram bot adapter labels Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants