Description
When sending a message to a plugin platform (e.g. XMPP) from a different platform session, send_message fails with:
No home channel set for xmpp to determine where to send the message.
This happens even when XMPP_HOME_CHANNEL is correctly set in .env.
Root Cause
In gateway/config.py, _apply_env_overrides() has hardcoded blocks for each built-in platform (Telegram, Discord, Slack, QQBot, Yuanbao, etc.) that read their respective {PREFIX}_HOME_CHANNEL env vars and populate config.platforms[platform].home_channel.
However, the generic plugin platform enable loop ("Registry-driven enable for plugin platforms" block) only sets config.platforms[platform].enabled = True — it never reads or applies home channel configuration from the environment.
Steps to Reproduce
- Install a plugin platform (e.g. XMPP)
- Set
XMPP_HOME_CHANNEL=room@conference.example.org in .env
- From a different platform (e.g. Telegram), call
send_message targeting xmpp
- Observe error despite env var being correctly set
Suggested Fix
Add home channel setup after the enabled = True line in the plugin platform loop:
config.platforms[platform].enabled = True
# Set home_channel from env if available (e.g. XMPP_HOME_CHANNEL)
prefix = entry.name.upper().replace("-", "_")
home_val = os.getenv(f"{prefix}_HOME_CHANNEL")
if home_val and not config.platforms[platform].home_channel:
config.platforms[platform].home_channel = HomeChannel(
platform=platform,
chat_id=home_val,
name=os.getenv(f"{prefix}_HOME_CHANNEL_NAME", "Home"),
)
Impact
Affects all plugin platforms. Any plugin that sets {NAME}_HOME_CHANNEL in .env will silently fail on cross-platform sends. The pattern of adding hardcoded blocks per platform (as seen in PR #13767 for MS Teams) does not scale — the generic loop should handle this for all plugins uniformly.
Environment
- hermes-agent main branch (as of 2026-05-04)
- Affected file:
gateway/config.py, function _apply_env_overrides()
Description
When sending a message to a plugin platform (e.g. XMPP) from a different platform session,
send_messagefails with:This happens even when
XMPP_HOME_CHANNELis correctly set in.env.Root Cause
In
gateway/config.py,_apply_env_overrides()has hardcoded blocks for each built-in platform (Telegram, Discord, Slack, QQBot, Yuanbao, etc.) that read their respective{PREFIX}_HOME_CHANNELenv vars and populateconfig.platforms[platform].home_channel.However, the generic plugin platform enable loop ("Registry-driven enable for plugin platforms" block) only sets
config.platforms[platform].enabled = True— it never reads or applies home channel configuration from the environment.Steps to Reproduce
XMPP_HOME_CHANNEL=room@conference.example.orgin.envsend_messagetargetingxmppSuggested Fix
Add home channel setup after the
enabled = Trueline in the plugin platform loop:Impact
Affects all plugin platforms. Any plugin that sets
{NAME}_HOME_CHANNELin.envwill silently fail on cross-platform sends. The pattern of adding hardcoded blocks per platform (as seen in PR #13767 for MS Teams) does not scale — the generic loop should handle this for all plugins uniformly.Environment
gateway/config.py, function_apply_env_overrides()