Summary
Hermes gateway currently assumes a single Telegram bot/account. In real deployments, it is often useful to run multiple Telegram bots side-by-side (for example a primary assistant bot plus a dev/team bot) and to route outbound messages explicitly through the intended account.
This issue proposes backward-compatible multi-account Telegram support across config loading, gateway startup, channel directory resolution, and send_message routing.
Problems observed
TELEGRAM_BOT_TOKEN supports only one Telegram account.
- Gateway startup creates only one Telegram adapter.
send_message cannot explicitly target a secondary Telegram account.
- Channel directory resolution assumes a single
telegram namespace, so account-specific label resolution is not possible.
- Runtime status / reconnect bookkeeping assumes adapter keys are enum platform values rather than account-qualified labels.
Proposed behavior
- Preserve existing single-account behavior.
- Add env/config support for extra Telegram accounts, e.g.
TELEGRAM_BOT_TOKEN_DEVTEAM.
- Start one adapter per configured Telegram account.
- Allow explicit outbound targeting via syntax like:
telegram:devteam:-1001234567890
telegram:devteam:-1001234567890:17585
telegram:devteam:Alerts Room
- Treat account-qualified directory namespaces as
telegram[devteam] internally while keeping fallback to base telegram entries.
- Ensure reconnect/runtime-status bookkeeping works with string adapter keys like
telegram[devteam].
Acceptance criteria
- Existing
telegram:* sends continue to work unchanged.
- Extra Telegram accounts can be configured from env/config.
- Gateway starts primary + extra Telegram adapters.
send_message resolves and sends via the correct account-specific token/config.
- Channel name resolution works for both
telegram and telegram[account] namespaces.
- Tests cover env parsing, runner startup, directory resolution, and send routing.
Validation performed locally
- Targeted test suite passed locally
- Live outbound sends were verified successfully through two distinct Telegram bot identities.
Notes
This is intended to be additive and backward-compatible. Existing single-account Telegram setups should continue to work without any configuration changes.
Summary
Hermes gateway currently assumes a single Telegram bot/account. In real deployments, it is often useful to run multiple Telegram bots side-by-side (for example a primary assistant bot plus a dev/team bot) and to route outbound messages explicitly through the intended account.
This issue proposes backward-compatible multi-account Telegram support across config loading, gateway startup, channel directory resolution, and
send_messagerouting.Problems observed
TELEGRAM_BOT_TOKENsupports only one Telegram account.send_messagecannot explicitly target a secondary Telegram account.telegramnamespace, so account-specific label resolution is not possible.Proposed behavior
TELEGRAM_BOT_TOKEN_DEVTEAM.telegram:devteam:-1001234567890telegram:devteam:-1001234567890:17585telegram:devteam:Alerts Roomtelegram[devteam]internally while keeping fallback to basetelegramentries.telegram[devteam].Acceptance criteria
telegram:*sends continue to work unchanged.send_messageresolves and sends via the correct account-specific token/config.telegramandtelegram[account]namespaces.Validation performed locally
Notes
This is intended to be additive and backward-compatible. Existing single-account Telegram setups should continue to work without any configuration changes.