diff --git a/gateway/config.py b/gateway/config.py index eb92d833e23..0ebf23e12d0 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -493,6 +493,13 @@ _PLATFORM_CONNECTED_CHECKERS: dict[Platform, Callable[[PlatformConfig], bool]] = (cfg.extra.get("client_id") or os.getenv("DINGTALK_CLIENT_ID")) and (cfg.extra.get("client_secret") or os.getenv("DINGTALK_CLIENT_SECRET")) ), + # Relay dials OUT to a connector; it is "connected" once an endpoint URL is + # configured (extra["relay_url"] or extra["url"]). The capability descriptor + # is negotiated at handshake time, so the URL is the only config-level + # signal in the experimental phase. EXPERIMENTAL — may change. + Platform.RELAY: lambda cfg: bool( + cfg.extra.get("relay_url") or cfg.extra.get("url") + ), } diff --git a/tests/gateway/test_platform_connected_checkers.py b/tests/gateway/test_platform_connected_checkers.py index f7677a3a676..e53e0fa4cfc 100644 --- a/tests/gateway/test_platform_connected_checkers.py +++ b/tests/gateway/test_platform_connected_checkers.py @@ -98,6 +98,8 @@ def test_checker_returns_true_when_configured(platform, checker, monkeypatch): mock_config.extra = {"app_id": "app", "app_secret": "sec"} elif platform == Platform.DINGTALK: mock_config.extra = {"client_id": "id", "client_secret": "sec"} + elif platform == Platform.RELAY: + mock_config.extra = {"relay_url": "wss://connector.example/relay"} else: pytest.skip(f"No synthetic config defined for {platform.value}")