Skip to content

fix(gateway): preserve thread routing for /update progress and prompts#18193

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-32a81481
May 1, 2026
Merged

fix(gateway): preserve thread routing for /update progress and prompts#18193
teknium1 merged 1 commit into
mainfrom
hermes/hermes-32a81481

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 1, 2026

Salvage of #17465 (@Yukipukii1) onto current main.

Summary

/update now keeps progress streams, interactive prompts, timeout notices, and post-restart completion notifications in the originating thread/topic. Previously only chat_id was persisted, so every /update reply fell back to the parent chat when invoked from a Telegram topic, Discord thread, or Slack thread.

Changes

  • gateway/run.py: persist thread_id in .update_pending.json; thread metadata={"thread_id": ...} through the watcher's stream/prompt/timeout/final-notification sends
  • gateway/platforms/telegram.py: send_update_prompt() honors message_thread_id
  • gateway/platforms/discord.py: send_update_prompt() targets the thread channel when present
  • Slack needs no adapter change — its existing send() already resolves metadata.thread_id to a thread_ts
  • Regression coverage in tests/gateway/test_update_command.py and tests/gateway/test_update_streaming.py

Validation

  • tests/gateway/test_update_command.py + tests/gateway/test_update_streaming.py — 48/48 passed
  • Verified on current main: zero thread_id references anywhere in the /update pending/watcher paths, so the reported routing loss is real

Closes #17465. Contributor authorship preserved via cherry-pick + rebase-merge.

@teknium1 teknium1 merged commit 25cbe3e into main May 1, 2026
9 of 10 checks passed
@teknium1 teknium1 deleted the hermes/hermes-32a81481 branch May 1, 2026 03:19
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter platform/discord Discord bot adapter labels May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants