Repository navigation
feat(media): let an origin attachment be the turn's reply (as_reply) - #54
Merged
Merged
Conversation
After a successful deliver_media, the final reply is replaced with a lone "✅" because Hermes refuses a bare NO_REPLY on a turn that expects a reply. On Telegram that ✅ arrives as a second message and reads as a reaction. deliver_media(..., as_reply=True) to the origin target now sends nothing at tool time. transform_media_delivery_output makes the attachment the final reply: the model's own words (minus silence markers, copied send notes and repeated MEDIA lines) followed by the MEDIA directive, so a NO_REPLY turn sends the voice note alone. Hermes delivers a MEDIA-only reply as one attachment with no text (BasePlatformAdapter._extract_response_content). If the reply never carries it (failed, interrupted or empty turn, or another transform won), clear_media_delivery_state, which Hermes fires after every turn, sends it directly, so a deferred attachment is never lost. Opt-in because success now means "accepted", not "sent": sirens' video lane records a confirmed-send receipt and must keep the direct send. Explicit targets and spoiler media always send directly; existing callers are unchanged. Claude-Session: https://claude.ai/code/session_01B6XeAXSoBKaEUbBRt5xcfB
offendingcommit
marked this pull request as ready for review
November 19, 2026 17:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After a successful
deliver_media,transform_media_delivery_outputreplaces the turn's final reply with a lone✅(#43). Hermes refuses a bareNO_REPLYon a turn that expects a reply. On Telegram the ✅ arrives as a second message after every voice memo or image, and it reads as a reaction.Change
deliver_media(..., as_reply=True)to theorigintarget sends nothing at tool time. It returnsdeferred=True,host_result={"deferred": "final_reply"}.transform_media_delivery_outputmakes the attachment the final reply: the model's own words, minus silence markers, copied[Sent …]notes and repeatedMEDIA:lines, then theMEDIA:directive. ANO_REPLYturn sends the attachment alone. Severalas_replycalls in one turn all ride the reply, in order.clear_media_delivery_state(Hermes fireson_session_endafter every turn) sends any deferred attachment the reply did not carry directly. That covers failed, interrupted and empty turns, another transform winning, and a session id rotated by compression. It is keyed on bothsession_idandtask_id.successnow means "accepted", not "sent". sirens' video lane writes a confirmed-send receipt and must keep the direct send. Explicit targets and spoiler media always send directly; existing callers are unchanged.docs/research/2026-11-19-telegram-checkmark-after-media.md.Proof
mise run test: 338 tests OK (28 skipped, host-only).mise run test-contract-pinned: receiptpinned bf0203a…; executed=28. Two new contract tests:test_deferred_media_reply_is_delivered_as_a_voice_note_aloneruns the reply through Hermes' ownBasePlatformAdapter.extract_mediaand gets one voice attachment with empty text.test_kit_silence_markers_match_the_hostpins the kit's marker set toLIVE_GATEWAY_SILENT_MARKERS. It caught the host's four Chinese markers on the first run.False and as_reply) fails 5 of the new tests.test_turn_end_sends_deferred_media_the_reply_never_carried.Not done yet
hermes-private. Expect exactly one voice note and no ✅, and a log showingmedia_delivery_deferredthenmedia_reply_attached.The deployed Hermes is
2bd378ed. The kit's contract pin isbf0203a. I read the deployed source in the pod for the paths this relies on, but the contract suite did not run against2bd378ed.https://claude.ai/code/session_01B6XeAXSoBKaEUbBRt5xcfB