mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
fix(gateway): ensure platform configs honor home_channel env overrides
This commit is contained in:
parent
5089c55e0b
commit
38875d00a7
2 changed files with 17 additions and 1 deletions
|
|
@ -1051,7 +1051,14 @@ def _apply_env_overrides(config: GatewayConfig) -> None:
|
|||
if Platform.WHATSAPP not in config.platforms:
|
||||
config.platforms[Platform.WHATSAPP] = PlatformConfig()
|
||||
config.platforms[Platform.WHATSAPP].enabled = True
|
||||
|
||||
whatsapp_home = os.getenv("WHATSAPP_HOME_CHANNEL")
|
||||
if whatsapp_home and Platform.WHATSAPP in config.platforms:
|
||||
config.platforms[Platform.WHATSAPP].home_channel = HomeChannel(
|
||||
platform=Platform.WHATSAPP,
|
||||
chat_id=whatsapp_home,
|
||||
name=os.getenv("WHATSAPP_HOME_CHANNEL_NAME", "Home"),
|
||||
)
|
||||
|
||||
# Slack
|
||||
slack_token = os.getenv("SLACK_BOT_TOKEN")
|
||||
if slack_token:
|
||||
|
|
|
|||
|
|
@ -455,6 +455,15 @@ class TestHomeChannelEnvOverrides:
|
|||
{"SLACK_HOME_CHANNEL": "C123", "SLACK_HOME_CHANNEL_NAME": "Ops"},
|
||||
("C123", "Ops"),
|
||||
),
|
||||
(
|
||||
Platform.WHATSAPP,
|
||||
PlatformConfig(enabled=True),
|
||||
{
|
||||
"WHATSAPP_HOME_CHANNEL": "1234567890@lid",
|
||||
"WHATSAPP_HOME_CHANNEL_NAME": "Owner DM",
|
||||
},
|
||||
("1234567890@lid", "Owner DM"),
|
||||
),
|
||||
(
|
||||
Platform.SIGNAL,
|
||||
PlatformConfig(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue