Skip to content

fix(media): attach a cron-skipped send to the job's reply, not a checkmark - #55

Draft
offendingcommit wants to merge 1 commit into
mainfrom
fix/cron-skipped-media-rides-reply
Draft

offendingcommit wants to merge 1 commit into
mainfrom
fix/cron-skipped-media-rides-reply

Conversation

@offendingcommit

Copy link
Copy Markdown
Owner

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_media judged success only by the absence of error / success: false, so it counted the skip as a delivery and armed the final-response suppression. transform_media_delivery_output then replaced the job's real reply, which carried the MEDIA: line, with ✅. The user received a lone checkmark and no attachment. Observed on two scheduled voice-memo runs in production.

Change

  • Any skipped: true host answer is no longer a delivery and never arms the suppression.
  • The cron duplicate-target skip defers the attachment into the job's final reply through the existing as_reply machinery (_defer_media_to_reply), and the result has deferred=True. persona-voice already reads deferred and tells the model to reply with the memo.
  • Every other skip returns success=False and leaves the reply alone.
  • CRON_DUPLICATE_SKIP_REASON is exported. The contract suite pins it to the host's _maybe_skip_cron_duplicate_send.
  • AGENTS.md, README and the authoring-skill reference describe the rule.

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 pin bf0203a7, including the new test_cron_duplicate_skip_reason_matches_the_host.
  • Falsifier: with the skipped check 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

  • Release the kit, then bump the pinned kit in the consuming plugins and the Hermes image so the gateways load it.
  • Live proof: a scheduled voice-memo run that delivers the memo, not ✅.

…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant