Skip to content

Skip reply alerts for silent scheduled runs - #64

Closed
altextreme wants to merge 1 commit into
promptclickrun:mainfrom
altextreme:fix/cron-silence-push
Closed

altextreme wants to merge 1 commit into
promptclickrun:mainfrom
altextreme:fix/cron-silence-push

Conversation

@altextreme

Copy link
Copy Markdown
Contributor

Problem

Since 2.17.0's faster reply alerts, a cron run that answers with Hermes's silence marker ([SILENT]) still reaches the phone as a push that reads [SILENT].

The Hermes scheduler correctly suppresses delivery on the job's own lane (e.g. Telegram): agent returned [SILENT] — skipping delivery. But ManagedNotifications._observe queues scheduled.completed from post_llm_call with the raw assistant_response and never checks for silence. The on_session_end fallback has the same gap.

On a 15-minute restock watch, that meant a [SILENT] push every quarter hour.

Fix

  • Adds _is_scheduled_silence(), which uses Hermes's own gateway.response_filters.is_autonomous_silence_response. That's the same predicate the scheduler uses, so the two can't drift. If the import isn't available, it falls back to a bracketed-prefix check.
  • For scheduled sessions only (platform == "cron" or a cron_* session id), a silent reply is not stored. That covers both the immediate post_llm_call alert and the on_session_end fallback.
  • Failed runs still alert. Interactive chats are unchanged: a chat reply of [SILENT] still alerts. Non-silent scheduled replies are unchanged.
  • The silence check runs on the raw reply, because _rich_text collapses newlines and would break the predicate's first-line and last-line rules.

Tests

  • test_silent_scheduled_run_sends_no_alert: [SILENT] and [SILENT] No qualifying restock. queue nothing, while a real result still sends scheduled.completed and a failure still sends scheduled.failed. This test fails on main and passes with the fix.
  • test_silence_marker_in_chat_still_alerts: chats are unaffected.
  • tests.test_managed_notifications, test_home_work_completions, test_managed_approval_notifications and test_notification_card_identity all pass (41 tests).

Verified live on a Hermes host running 2.17.0 plus this patch: the next silent cron run queued no notification events, while the two silent runs before the patch each queued one.

🤖 Generated with Claude Code

A cron run that answers with Hermes's silence marker ([SILENT]) is
suppressed on its delivery lane by the scheduler, but the post_llm_call
reply alert (added in 2.17.0) still pushed the raw marker to the phone.

Scheduled sessions now check the reply with Hermes's own
gateway.response_filters.is_autonomous_silence_response, the predicate
the scheduler uses, and keep no reply when it matches. That covers both
the immediate alert and the on_session_end fallback. Failed runs still
alert, and interactive chats are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
promptclickrun added a commit that referenced this pull request Sep 28, 2026
Includes #64: a scheduled run answering [SILENT] no longer pushes \"[SILENT]\". Extends it to all of Hermes' silence rules (gateway/response_filters.py): loose rule for scheduled tasks and webhooks; exact rule elsewhere, silent only when no person is waiting (off-screen notes, internal notifications, messages not addressed to the agent); a person's message that got only a marker alerts Hermes' own notice. Older Hermes keeps every bare marker quiet.

Co-authored-by: Anthony <anthony@tackettdesign.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@promptclickrun

Copy link
Copy Markdown
Owner

Thanks, Anthony! This was spot on. It's now merged as part of #67 (2.18.1), with your commit kept and you credited as co-author. #67 builds on it to follow the rest of Hermes' silence rules (webhooks, internal notifications, and a notice when a person's message gets only a marker). Closing this one as included there.

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.

2 participants