Repository navigation
feat(media): strip copied sent-media history notes from final replies - #46
Merged
offendingcommit merged 2 commits intoOct 30, 2026
Merged
offendingcommit merged 2 commits into
offendingcommit merged 2 commits into
Conversation
Hermes' send_message records each media send as an assistant line
("[Sent voice message]", "[Sent audio attachment]", ...) so the model
remembers it. Models copy those lines into real replies and users
receive them as text: 142 such lines in the private members' final
replies, every one on its own line.
strip_media_mirror_lines removes whole matching lines and returns None
when there are none; a reply left empty or bare NO_REPLY becomes
MEDIA_DELIVERED_REPLY. A contract test feeds it every shape the host's
own _describe_media_for_mirror produces.
Claude-Session: https://claude.ai/code/session_01B6XeAU5Gn7ZaLQJVSg4AKC
…irror-lines # Conflicts: # tests/test_hermes_contract.py
3 tasks
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.
Stacked on #43, which adds
MEDIA_DELIVERED_REPLY.Problem
After each media send, Hermes's
send_messagewrites an assistant line into the history so the model remembers what it sent (_describe_media_for_mirror):[Sent voice message],[Sent image attachment],[Sent audio attachment]and so on. Models copy these lines into real replies, and users receive them as text. The private members' final replies contain 142 such lines, and every one sits on its own line.Change
New
strip_media_mirror_lines(text):Nonewhen there is nothing to remove;NO_REPLY, becomesMEDIA_DELIVERED_REPLY.memory-sync's composable
transform_llm_outputwill call it, because memory-sync runs on all 14 members and persona-voice skips the Discord ones. Calling it from memory-sync also avoids Hermes's first-hook-wins rule.Proof
_describe_media_for_mirrorproduces is stripped. It passes on the v0.21.2 pin and on v0.22.5 (bf0203a7).audiofrom the pattern fails the contract subtestnote='[Sent audio attachment]'.https://claude.ai/code/session_01B6XeAU5Gn7ZaLQJVSg4AKC