Skip to content

2.18.2: reply alerts go out the moment the reply is saved - #68

Merged
promptclickrun merged 1 commit into
mainfrom
fix/send-alerts-immediately
Sep 28, 2026
Merged

promptclickrun merged 1 commit into
mainfrom
fix/send-alerts-immediately

Conversation

@promptclickrun

Copy link
Copy Markdown
Owner

Problem: reply alerts took 10–15 s. On the maintainer's host, the journal showed each alert queued within a second of the reply being saved, but only claimed for sending about 5 s later.

  • The background sender runs in whichever Hermes process holds worker.lock. There, that was a dashboard started two days earlier on plugin 2.16, which polled every 5 s.
  • Other processes' wake-ups don't reach that thread.

Fix

  • _queue_event sends reply, task, helper and clarification alerts at once, on a short-lived thread in the process that queued them (_send_now).
  • The per-alert send moved into _send_row. Both the immediate path and the owner's drain claim the row atomically (pending → sending), so each alert is sent exactly once.
  • Approvals are unchanged: they keep their 3 s grace period and the owner-only attention checks.
  • Tests with an injected transport keep sending only when they drain; send_on_queue opts in.

Tests

  • New test_a_reply_alert_goes_out_as_soon_as_it_is_queued (and no second send from the drain).
  • New test_approval_waits_for_its_owner_instead_of_sending_on_queue.
  • The notification suites pass (50 tests).
  • The full suite on Hermes 0.21.2 matches main, with the same single environment-bound failure.

Docs: docs/NOTIFICATIONS.md. Version 2.18.2.

🤖 Generated with Claude Code

One Hermes process owns the background sender (a file lock), and it only
noticed alerts queued by other processes when it next polled: every 5 s in
2.16, 1 s since 2.17. A long-running process on an older plugin kept owning
it, so alerts sat for several seconds before sending. Now the process that
queued a reply, task or helper alert sends it right away on its own thread.
Both paths claim each alert atomically before sending, so it goes out once.
Approval alerts keep their grace period and stay with the owning sender.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@promptclickrun
promptclickrun merged commit 34f2a16 into main Sep 28, 2026
2 checks passed
@promptclickrun
promptclickrun deleted the fix/send-alerts-immediately branch September 28, 2026 09:28
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