From cc61009a6933281be6977fc61251af72fab82c02 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Fri, 30 Oct 2026 13:49:16 -0500 Subject: [PATCH 1/2] fix(media): end a delivered-media turn with a visible reply, not NO_REPLY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hermes v0.22.5 rejects a bare silence marker on a turn that expects a reply (gateway/response_filters.py silence_allowed) and sends the user "The model returned only a silence marker for a message that needed a reply" instead. After a successful deliver_media, transform_media_delivery_output forced exactly that marker, so every directly sent voice memo or image was followed by the warning even though the attachment arrived. Return MEDIA_DELIVERED_REPLY (a single ✅) instead. Consumers that pin the kit (persona-voice, sirens) pick it up with a pin bump. Claude-Session: https://claude.ai/code/session_01B6XeAU5Gn7ZaLQJVSg4AKC --- README.md | 6 ++++-- hermes_plugin_kit/__init__.py | 13 ++++++++++--- tests/test_kit.py | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index be0c223..8dde4ca 100644 --- a/README.md +++ b/README.md @@ -733,8 +733,10 @@ def register(ctx): ``` Successful delivery arms a one-turn marker for the current Hermes session. -`transform_media_delivery_output` consumes it and returns Hermes' canonical -`NO_REPLY` response before the gateway sees the final text. Failed delivery does +`transform_media_delivery_output` consumes it and replaces the final text with +`MEDIA_DELIVERED_REPLY` (a single ✅) before the gateway sees it. It does not +return `NO_REPLY`: Hermes v0.22+ rejects a silence marker on a turn that expects +a reply and sends the user a warning instead. Failed delivery does not arm suppression, and `on_session_end` clears any unconsumed marker. These are Hermes-agent lifecycle and response contracts; they are not OpenClaw shapes. diff --git a/hermes_plugin_kit/__init__.py b/hermes_plugin_kit/__init__.py index 5a2b1cc..2011259 100644 --- a/hermes_plugin_kit/__init__.py +++ b/hermes_plugin_kit/__init__.py @@ -94,6 +94,7 @@ def register(ctx): "SessionDBCompatibilityError", "deliver_media", "resolve_delivery_target", + "MEDIA_DELIVERED_REPLY", "transform_media_delivery_output", "clear_media_delivery_state", "MediaType", @@ -1856,6 +1857,10 @@ def _mark_media_delivery_success(context: dict[str, Any]) -> None: ) +# The turn's visible reply after the attachment itself was already sent. +MEDIA_DELIVERED_REPLY = "✅" + + def transform_media_delivery_output( response_text: str = "", session_id: str = "", @@ -1865,8 +1870,10 @@ def transform_media_delivery_output( A successful :func:`deliver_media` call arms one task-local suppression. The finalizer then replaces any model-authored text or repeated ``MEDIA`` - tag with Hermes' canonical ``NO_REPLY`` marker. State is consumed once, so - later turns in the same session are unaffected. + tag with :data:`MEDIA_DELIVERED_REPLY`. Not ``NO_REPLY``: Hermes v0.22+ + rejects a silence marker on a turn that expects a reply and sends a + warning instead. State is consumed once, so later turns in the same + session are unaffected. """ context_id = str(session_id or "").strip() if not context_id: @@ -1881,7 +1888,7 @@ def transform_media_delivery_output( "event=media_final_response_suppressed original_chars=%d", len(str(response_text or "")), ) - return "NO_REPLY" + return MEDIA_DELIVERED_REPLY def clear_media_delivery_state( diff --git a/tests/test_kit.py b/tests/test_kit.py index 47f8aaa..1ed7990 100644 --- a/tests/test_kit.py +++ b/tests/test_kit.py @@ -1211,7 +1211,7 @@ def test_successful_delivery_suppresses_the_same_turn_final_response_once(self) session_id="session-1", platform="telegram", ), - "NO_REPLY", + "✅", ) self.assertIsNone( hpk.transform_media_delivery_output( From 3d7eefd133051ed6687875774900f2acd6b82216 Mon Sep 17 00:00:00 2001 From: Offending Commit Date: Fri, 30 Oct 2026 13:56:13 -0500 Subject: [PATCH 2/2] test(media): check the delivered-media reply against Hermes' own silence rule Imports gateway.response_filters.is_intentional_silence_response from the pinned Hermes host instead of trusting a copied marker, so a future Hermes that widens its silence set fails the contract lane rather than users. Claude-Session: https://claude.ai/code/session_01B6XeAU5Gn7ZaLQJVSg4AKC --- tests/test_hermes_contract.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_hermes_contract.py b/tests/test_hermes_contract.py index bd29a2e..19a86e9 100644 --- a/tests/test_hermes_contract.py +++ b/tests/test_hermes_contract.py @@ -689,6 +689,13 @@ def test_lifecycle_calls_bind_to_real_plugincontext_signatures(self) -> None: for method in ("launch", "status", "wait", "cancel", "result", "reconnect"): self.assertTrue(callable(getattr(service, method))) + def test_media_delivered_reply_is_not_a_hermes_silence_marker(self) -> None: + """Hermes v0.22+ replaces a silence marker on a user turn with a warning.""" + from gateway.response_filters import is_intentional_silence_response # type: ignore + + self.assertTrue(is_intentional_silence_response("NO_REPLY")) + self.assertFalse(is_intentional_silence_response(hpk.MEDIA_DELIVERED_REPLY)) + def test_host_tool_invocation_reaches_real_telegram_media_contract(self) -> None: """Exercise Hermes media parsing and Telegram formatting without network I/O.""" import asyncio