Files
hermes-agent/gateway
brooklyn! 34343e79ab fix(gateway): stop anchoring synthetic process notifications to the stale trigger message (#123097)
Background-process completions and watch events re-enter the gateway as
synthetic MessageEvent(internal=True) turns carrying the id of the message
that STARTED the process (captured at spawn time via
HERMES_SESSION_MESSAGE_ID, persisted as watcher_message_id, replayed on the
queued event). By delivery time that message is old news: the user has
typically continued elsewhere, and _reply_anchor_for_event made the finished
job's reply quote it on every reply-anchoring platform — on Discord the
completion visibly answered a stale DM message from a different topic
(#52694).

The synthetic event is not a reply to the trigger message. Drop the id from
the event and from the restored origin source (the same strip
run_goals._synthetic_prompt_event applies to goal/loop prompts), keep it in
event metadata as original_trigger_message_id for debugging, and leave
routing untouched: thread/topic lanes carry thread_id and the anchor-less
synthetic-send branches are already covered (#87051).

Fixes #52694

Co-authored-by: Hermes Agent <agent@hermes.local>
2026-09-25 21:28:55 +00:00
..