diff --git a/gateway/config.py b/gateway/config.py index 94136291284..0591503938b 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -1062,6 +1062,12 @@ def load_gateway_config() -> GatewayConfig: extra = {} plat_data["extra"] = extra extra[_telegram_extra_key] = telegram_cfg[_telegram_extra_key] + if _telegram_extra: + _plat_data, _plat_extra = _ensure_platform_extra_dict( + platforms_data, Platform.TELEGRAM.value + ) + for _telegram_extra_key, _telegram_extra_value in _telegram_extra.items(): + _plat_extra.setdefault(_telegram_extra_key, _telegram_extra_value) whatsapp_cfg = yaml_cfg.get("whatsapp", {}) if isinstance(whatsapp_cfg, dict): diff --git a/tests/gateway/test_config.py b/tests/gateway/test_config.py index fdd5e72f680..da7673011fe 100644 --- a/tests/gateway/test_config.py +++ b/tests/gateway/test_config.py @@ -551,6 +551,26 @@ class TestLoadGatewayConfig: assert config.platforms[Platform.TELEGRAM].extra["disable_link_previews"] is True + def test_bridges_telegram_extra_base_url_from_config_yaml(self, tmp_path, monkeypatch): + hermes_home = tmp_path / ".hermes" + hermes_home.mkdir() + config_path = hermes_home / "config.yaml" + config_path.write_text( + "telegram:\n" + " extra:\n" + " base_url: https://custom-proxy.example.com/bot\n", + encoding="utf-8", + ) + + monkeypatch.setenv("HERMES_HOME", str(hermes_home)) + + config = load_gateway_config() + + assert ( + config.platforms[Platform.TELEGRAM].extra["base_url"] + == "https://custom-proxy.example.com/bot" + ) + def test_bridges_notice_delivery_from_config_yaml(self, tmp_path, monkeypatch): hermes_home = tmp_path / ".hermes" hermes_home.mkdir()