Fix Telegram topic routing for background process updates#1146
Closed
spanishflu-est1918 wants to merge 1 commit intoNousResearch:mainfrom
Closed
Fix Telegram topic routing for background process updates#1146spanishflu-est1918 wants to merge 1 commit intoNousResearch:mainfrom
spanishflu-est1918 wants to merge 1 commit intoNousResearch:mainfrom
Conversation
4cad856 to
5b91d81
Compare
teknium1
pushed a commit
that referenced
this pull request
Mar 16, 2026
… topics Salvaged from PR #1146 by spanishflu-est1918. Background process progress/completion messages were sent with only chat_id, landing in the general topic instead of the originating forum topic. Thread the thread_id from HERMES_SESSION_THREAD_ID through the watcher payload and pass it as metadata to adapter.send() so Telegram routes notifications to the correct topic. The env var export (HERMES_SESSION_THREAD_ID in _set_session_env / _clear_session_env) already existed on main — this commit adds the missing watcher plumbing.
Contributor
|
Merged via PR #1481. The core fix (watcher thread_id plumbing → adapter.send metadata) was salvaged onto current main with authorship preserved. The env var export part was already on main. Thanks for the contribution! |
teknium1
added a commit
that referenced
this pull request
Mar 16, 2026
… topics (#1481) Salvaged from PR #1146 by spanishflu-est1918. Background process progress/completion messages were sent with only chat_id, landing in the general topic instead of the originating forum topic. Thread the thread_id from HERMES_SESSION_THREAD_ID through the watcher payload and pass it as metadata to adapter.send() so Telegram routes notifications to the correct topic. The env var export (HERMES_SESSION_THREAD_ID in _set_session_env / _clear_session_env) already existed on main — this commit adds the missing watcher plumbing. Co-authored-by: spanishflu-est1918 <spanishflu-est1918@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Telegram forum topic routing for background process progress/completion messages.
What changed
gateway/run.pyHERMES_SESSION_THREAD_IDfrom the active session contextthread_idin background watcher metadatametadata={"thread_id": ...}so Telegram replies land in the originating topictools/terminal_tool.pythread_idin pending watcher payloadsWhy
In Telegram forum chats, background process updates were being delivered with only
chat_id, which sends them to the default/general topic instead of the originating topic.Related issues
Notes
This is a focused fix for background-process topic routing only. Mention/wake-gate behavior is intentionally not part of this PR.