Repository navigation
fix(media): attach a cron-skipped send to the job's reply, not a checkmark - #55
Draft
offendingcommit wants to merge 1 commit into
Draft
offendingcommit wants to merge 1 commit into
offendingcommit wants to merge 1 commit into
Conversation
…kmark Inside a cron run, Hermes' send_message skips a send to the chat the job already auto-delivers to and answers success: true, skipped: true, reason cron_auto_delivery_duplicate_target. deliver_media read that as a delivery, armed the final-response suppression, and the job's real reply (with its MEDIA line) was replaced by a lone checkmark. The voice memo never left. deliver_media now treats any skipped send as not delivered. For the cron duplicate-target skip it defers the attachment into the job's final reply (the as_reply path), so the memo arrives with that reply. Every other skip returns success=False and leaves the reply alone. CRON_DUPLICATE_SKIP_REASON is exported and pinned to the host's _maybe_skip_cron_duplicate_send by the contract suite.
This branch has not been deployed
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
In a cron run, a plugin that delivers media to the chat the job already auto-delivers to gets this from Hermes'
send_message:{"success": true, "skipped": true, "reason": "cron_auto_delivery_duplicate_target", "target": "telegram:<chat>"}deliver_mediajudged success only by the absence oferror/success: false, so it counted the skip as a delivery and armed the final-response suppression.transform_media_delivery_outputthen replaced the job's real reply, which carried theMEDIA:line, with✅. The user received a lone checkmark and no attachment. Observed on two scheduled voice-memo runs in production.Change
skipped: truehost answer is no longer a delivery and never arms the suppression.as_replymachinery (_defer_media_to_reply), and the result hasdeferred=True. persona-voice already readsdeferredand tells the model to reply with the memo.success=Falseand leaves the reply alone.CRON_DUPLICATE_SKIP_REASONis exported. The contract suite pins it to the host's_maybe_skip_cron_duplicate_send.Validation
mise run test: 342 tests OK (29 contract tests skipped in that lane).mise run test-contract-pinned: 29 OK against the deployed Hermes pinbf0203a7, including the newtest_cron_duplicate_skip_reason_matches_the_host.skippedcheck disabled, the three new unit tests fail (test_cron_skipped_send_rides_the_final_reply_instead_of_a_checkmark,test_cron_skipped_send_keeps_the_model_words_beside_the_memo,test_other_skipped_send_is_not_a_delivery).Not yet done
✅.