From e0b2bdb089dd86adc74298f22b649d684785a616 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 2 Apr 2026 14:00:22 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20webhook=20platform=20support=20=E2=80=94?= =?UTF-8?q?=20skip=20home=20channel=20prompt,=20disable=20tool=20progress?= =?UTF-8?q?=20(salvage=20#4363)=20(#4660)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cherry-picked from PR #4363 by @bennyhodl with follow-up fixes: - Skip 'No home channel' prompt for webhook platform (webhooks deliver to configured targets, not a home channel) - Disable tool progress for webhooks (no message editing support) - Add webhook to PLATFORMS in tools_config.py and skills_config.py - Add hermes-webhook toolset to toolsets.py + hermes-gateway includes - Removed overly aggressive <50 char content filter that blocked legitimate short responses (tool progress already handled at source) Co-authored-by: bennyhodl --- gateway/run.py | 8 ++++++-- hermes_cli/skills_config.py | 1 + hermes_cli/tools_config.py | 1 + toolsets.py | 8 +++++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gateway/run.py b/gateway/run.py index bea75af013..1beb70d3b0 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -2449,7 +2449,8 @@ class GatewayRunner: ) # One-time prompt if no home channel is set for this platform - if not history and source.platform and source.platform != Platform.LOCAL: + # Skip for webhooks - they deliver directly to configured targets (github_comment, etc.) + if not history and source.platform and source.platform != Platform.LOCAL and source.platform != Platform.WEBHOOK: platform_name = source.platform.value env_key = f"{platform_name.upper()}_HOME_CHANNEL" if not os.getenv(env_key): @@ -5356,7 +5357,10 @@ class GatewayRunner: or os.getenv("HERMES_TOOL_PROGRESS_MODE") or "all" ) - tool_progress_enabled = progress_mode != "off" + # Disable tool progress for webhooks - they don't support message editing, + # so each progress line would be sent as a separate message. + from gateway.config import Platform + tool_progress_enabled = progress_mode != "off" and source.platform != Platform.WEBHOOK # Queue for progress messages (thread-safe) progress_queue = queue.Queue() if tool_progress_enabled else None diff --git a/hermes_cli/skills_config.py b/hermes_cli/skills_config.py index 07ccd0af91..7b44014ea5 100644 --- a/hermes_cli/skills_config.py +++ b/hermes_cli/skills_config.py @@ -30,6 +30,7 @@ PLATFORMS = { "dingtalk": "💬 DingTalk", "feishu": "🪽 Feishu", "wecom": "💬 WeCom", + "webhook": "🔗 Webhook", } # ─── Config Helpers ─────────────────────────────────────────────────────────── diff --git a/hermes_cli/tools_config.py b/hermes_cli/tools_config.py index 4410dc81ee..73282fe090 100644 --- a/hermes_cli/tools_config.py +++ b/hermes_cli/tools_config.py @@ -150,6 +150,7 @@ PLATFORMS = { "wecom": {"label": "💬 WeCom", "default_toolset": "hermes-wecom"}, "api_server": {"label": "🌐 API Server", "default_toolset": "hermes-api-server"}, "mattermost": {"label": "💬 Mattermost", "default_toolset": "hermes-mattermost"}, + "webhook": {"label": "🔗 Webhook", "default_toolset": "hermes-webhook"}, } diff --git a/toolsets.py b/toolsets.py index ad762555bd..25946ea7bf 100644 --- a/toolsets.py +++ b/toolsets.py @@ -369,10 +369,16 @@ TOOLSETS = { "includes": [] }, + "hermes-webhook": { + "description": "Webhook toolset - receive and process external webhook events", + "tools": _HERMES_CORE_TOOLS, + "includes": [] + }, + "hermes-gateway": { "description": "Gateway toolset - union of all messaging platform tools", "tools": [], - "includes": ["hermes-telegram", "hermes-discord", "hermes-whatsapp", "hermes-slack", "hermes-signal", "hermes-homeassistant", "hermes-email", "hermes-sms", "hermes-mattermost", "hermes-matrix", "hermes-dingtalk", "hermes-feishu", "hermes-wecom"] + "includes": ["hermes-telegram", "hermes-discord", "hermes-whatsapp", "hermes-slack", "hermes-signal", "hermes-homeassistant", "hermes-email", "hermes-sms", "hermes-mattermost", "hermes-matrix", "hermes-dingtalk", "hermes-feishu", "hermes-wecom", "hermes-webhook"] } }