The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(status): one row per messaging platform, judged by the gateway (#96190)
teknium125aa38c0084f
diff --git a/hermes_cli/status.py b/hermes_cli/status.pyindex 060730b2773..c83d0c9d1b6 100644--- a/hermes_cli/status.py+++ b/hermes_cli/status.py@@ -112,16 +112,11 @@ _TERMINAL_ENV_ROWS = {"daytona": (("Daytona Image:", "TERMINAL_DAYTONA_IMAGE", DEFAULT_SANDBOX_IMAGE, False),),}-_PLATFORMS = { # name -> (token env var, home-channel env var or None)- "Telegram": ("TELEGRAM_BOT_TOKEN", "TELEGRAM_HOME_CHANNEL"),- "Discord": ("DISCORD_BOT_TOKEN", "DISCORD_HOME_CHANNEL"), "WhatsApp": ("WHATSAPP_ENABLED", None),- "Signal": ("SIGNAL_HTTP_URL", "SIGNAL_HOME_CHANNEL"),- "Slack": ("SLACK_BOT_TOKEN", None), "Email": ("EMAIL_ADDRESS", "EMAIL_HOME_ADDRESS"),- "SMS": ("TWILIO_ACCOUNT_SID", "SMS_HOME_CHANNEL"), "DingTalk": ("DINGTALK_CLIENT_ID", None),- "Feishu": ("FEISHU_APP_ID", "FEISHU_HOME_CHANNEL"), "WeCom": ("WECOM_BOT_ID", "WECOM_HOME_CHANNEL"),- "WeCom Callback": ("WECOM_CALLBACK_CORP_ID", None), "Weixin": ("WEIXIN_ACCOUNT_ID", "WEIXIN_HOME_CHANNEL"),- "BlueBubbles": ("BLUEBUBBLES_SERVER_URL", "BLUEBUBBLES_HOME_CHANNEL"), "QQBot": ("QQ_APP_ID", "QQ_HOME_CHANNEL"),- "Yuanbao": ("YUANBAO_APP_ID", "YUANBAO_HOME_CHANNEL")}+# Labels for built-in adapters without a platform-registry entry; registry entries bring their own.+_PLATFORM_LABELS = {"telegram": "Telegram", "discord": "Discord", "whatsapp": "WhatsApp", "signal": "Signal",+ "slack": "Slack", "email": "Email", "sms": "SMS", "dingtalk": "DingTalk", "feishu": "Feishu",+ "wecom": "WeCom", "wecom_callback": "WeCom Callback", "weixin": "Weixin",+ "bluebubbles": "BlueBubbles", "qqbot": "QQBot", "yuanbao": "Yuanbao"}# Gateway manager label when the runtime snapshot is unavailable, keyed by platform._GATEWAY_FALLBACK = {"termux": ("unknown", "Termux / manual process"), "linux": ("unknown", "systemd/manual"),@@ -202,19 +197,21 @@ def _render_terminal(ctx):def _render_platforms(ctx):+ """One row per platform, judged by the gateway (same verdict as the summary's Platforms line)."""_section("Messaging Platforms")- for name, (token_var, home_var) in _PLATFORMS.items():- has_token = bool(os.getenv(token_var, ""))- home_channel = os.getenv(home_var, "") if home_var else ""- _row(name, has_token, _configured(has_token) + (f" (home: {home_channel})" if home_channel else ""))-- try: # Plugin platforms: the gateway's own verdict, never the check_fn "SDK importable" probe+ try:+ from gateway.config import load_gateway_configfrom gateway.platform_registry import platform_registry- connected = {p.value for p in _connected_platforms()}- for entry in platform_registry.plugin_entries():- _row(entry.label, entry.name in connected, f"{_configured(entry.name in connected)} (plugin)")+ cfg = load_gateway_config()except Exception:- pass+ return+ connected = {p.value for p in cfg.get_connected_platforms()}+ homes = {p.value: pc.home_channel for p, pc in cfg.platforms.items() if pc.home_channel}+ labels = {**_PLATFORM_LABELS, **{e.name: e.label for e in platform_registry.plugin_entries()}}+ for value, label in sorted(labels.items(), key=lambda kv: kv[1].lower()):+ home = homes.get(value)+ _row(label, value in connected,+ _configured(value in connected) + (f" (home: {home.chat_id})" if home else ""))def _render_gateway(ctx):diff --git a/tests/hermes_cli/test_status.py b/tests/hermes_cli/test_status.pyindex 90699d68d8a..320138dd318 100644--- a/tests/hermes_cli/test_status.py+++ b/tests/hermes_cli/test_status.py@@ -252,7 +252,7 @@ def test_status_defaults_to_summary_and_full_or_all_prints_every_section(monkeypdef test_platform_rows_follow_the_gateway_verdict_not_check_fn(monkeypatch, capsys, tmp_path):- """check_fn only says the SDK imports; a bundled plugin with no token is not configured."""+ """check_fn only says the SDK imports; each platform gets ONE row, judged like the summary line."""import gateway.config as gateway_configfrom gateway.platform_registry import platform_registry@@ -260,10 +260,12 @@ def test_platform_rows_follow_the_gateway_verdict_not_check_fn(monkeypatch, capsentries = [SimpleNamespace(name=n, label=n.title(), check_fn=lambda: True) for n in ("telegram", "discord")]monkeypatch.setattr(platform_registry, "plugin_entries", lambda: entries)monkeypatch.setattr(gateway_config, "load_gateway_config", lambda: SimpleNamespace(- get_connected_platforms=lambda: [SimpleNamespace(value="telegram")]))+ platforms={}, get_connected_platforms=lambda: [SimpleNamespace(value="telegram")]))show_status(SimpleNamespace(full=True, deep=False))- plugin_rows = [line for line in capsys.readouterr().out.splitlines() if "(plugin)" in line]- assert any("Discord" in line and "not configured" in line for line in plugin_rows)+ out = capsys.readouterr().out+ rows = {name: [line for line in out.splitlines() if line.strip().startswith(name)] for name in ("Telegram", "Discord")}+ assert [("not configured" in line) for line in rows["Discord"]] == [True]+ assert [("not configured" in line) for line in rows["Telegram"]] == [False]show_status(SimpleNamespace())assert "Platforms: Telegram\n" in capsys.readouterr().outdiff --git a/website/docs/developer-guide/adding-platform-adapters.md b/website/docs/developer-guide/adding-platform-adapters.mdindex 17b03d261ec..cfe6c706f7e 100644--- a/website/docs/developer-guide/adding-platform-adapters.md+++ b/website/docs/developer-guide/adding-platform-adapters.md@@ -224,7 +224,7 @@ When you call `ctx.register_platform()`, the following integration points are ha| System prompt hints | `platform_hint` injected into LLM context || Message chunking | `max_message_length` for smart splitting || PII redaction | `pii_safe` flag |-| `hermes status` | Shows plugin platforms with `(plugin)` tag |+| `hermes status` | Lists plugin platforms alongside built-ins, one row each, using the gateway's own configured check || `hermes gateway setup` | Plugin platforms appear in setup menu || `hermes tools` / `hermes skills` | Plugin platforms in per-platform config || Token lock (multi-profile) | Use `acquire_scoped_lock()` in your `connect()` |