fix(gateway): preserve thread routing for process completions#24222
fix(gateway): preserve thread routing for process completions#24222web3blind wants to merge 1 commit into
Conversation
|
Additional routing note from user report: The observed misdelivery may correlate with cron outputs delivered to a Telegram topic (e.g. a farm/cron topic) while a background process from another topic completes later. This PR addresses that failure mode for process completions by making queued completion events self-routable: the event now carries platform/chat_id/thread_id/user metadata from the original process-starting context, and gateway injection reconstructs the synthetic MessageEvent from the event itself rather than any currently active foreground topic. Cron delivery itself already resolves thread_id from job origin or explicit deliver targets, and cron agent runs intentionally clear HERMES_SESSION_* context so cron ticks do not masquerade as live inbound gateway messages. The added regression test |
liuhao1024
left a comment
There was a problem hiding this comment.
The plan.md file looks like a development planning document that was accidentally included in this PR. It should be removed before merging — it doesn't belong in the repo and exposes internal design rationale that's better suited to the PR description.
|
I rechecked this against current
No baseline CI conflicts seen — this PR should merge cleanly. |
581042b to
b0c6965
Compare
b0c6965 to
7fb0c50
Compare
Summary
Tests
Why
Delayed background-process notifications must route to the original Telegram topic/thread where the process was launched, not whichever topic is active when the notification is drained.