From 74a5e88168ee671579f8afa816351420b6eace77 Mon Sep 17 00:00:00 2001 From: Tommy-Lee Date: Wed, 6 May 2026 12:24:54 +0200 Subject: [PATCH] fix(cli): correct WhatsApp platform detection and add Matrix support in tools menu - WhatsApp: check for explicit truthy values (true/1/yes) instead of treating any non-empty string as enabled. Previously WHATSAPP_ENABLED=false would still show WhatsApp in the hermes tools menu. - Matrix: add detection via MATRIX_HOMESERVER + (MATRIX_ACCESS_TOKEN or MATRIX_PASSWORD). Matrix was entirely missing from the platform list. Fixes: platform shown in tools menu despite being disabled in .env --- hermes_cli/tools_config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 14d82caa653d9..224aaee64a716 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -764,10 +764,17 @@ def _get_enabled_platforms() -> List[str]: enabled.append("discord") if get_env_value("SLACK_BOT_TOKEN"): enabled.append("slack") - if get_env_value("WHATSAPP_ENABLED"): + whatsapp_enabled = get_env_value("WHATSAPP_ENABLED", "").lower() + if whatsapp_enabled in ("true", "1", "yes"): enabled.append("whatsapp") if get_env_value("QQ_APP_ID"): enabled.append("qqbot") + # Matrix: check for homeserver URL (required) and either access token or password + matrix_homeserver = get_env_value("MATRIX_HOMESERVER") + matrix_token = get_env_value("MATRIX_ACCESS_TOKEN") + matrix_password = get_env_value("MATRIX_PASSWORD") + if matrix_homeserver and (matrix_token or matrix_password): + enabled.append("matrix") return enabled