Skip to content

fix(cron): support Telegram topic delivery via platform:chat_id:thread_id format (salvage #2037)#2455

Merged
teknium1 merged 1 commit intomainfrom
hermes/hermes-5e6ebebb
Mar 22, 2026
Merged

fix(cron): support Telegram topic delivery via platform:chat_id:thread_id format (salvage #2037)#2455
teknium1 merged 1 commit intomainfrom
hermes/hermes-5e6ebebb

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

Summary

Salvage of PR #2037 by @alexferrari88, cherry-picked onto current main.

Cron job delivery to Telegram topics (forum threads) was broken — _resolve_delivery_target() always set thread_id=None when parsing the platform:chat_id format, so deliver: telegram:-1003724596514:17 lost the thread ID.

Fix

Parses the optional :thread_id suffix from explicit deliver targets. Handles negative Telegram chat IDs correctly via split(':', 1).

  • telegram:-1003724596514:17 → chat_id=-1003724596514, thread_id=17
  • telegram:-1003724596514 → chat_id=-1003724596514, thread_id=None
  • discord:#engineering → unchanged behavior

Changes

  • cron/scheduler.py: parse thread_id from deliver target
  • tests/cron/test_scheduler.py: 2 new tests
  • tools/cronjob_tools.py: updated schema description with thread_id format + examples

Verification

  • 5791 passed (pre-existing failures identical to main)
  • Scheduler tests: 34/34 passed

Credit

Original work by @alexferrari88 in #2037. Contributor authorship preserved via cherry-pick.

…d_id format

Parse thread_id from explicit deliver target (e.g. telegram:-1003724596514:17)
and forward it to _send_to_platform and mirror_to_session.

Previously _resolve_delivery_target() always set thread_id=None when
parsing the platform:chat_id format, breaking cron job delivery to
specific Telegram topics.

Added tests:
- test_explicit_telegram_topic_target_with_thread_id
- test_explicit_telegram_chat_id_without_thread_id

Also updated CRONJOB_SCHEMA deliver description to document the
platform:chat_id:thread_id format.
@teknium1 teknium1 merged commit 89befca into main Mar 22, 2026
1 check failed
outsourc-e pushed a commit to outsourc-e/hermes-agent that referenced this pull request Mar 26, 2026
…d_id format (NousResearch#2455)

Parse thread_id from explicit deliver target (e.g. telegram:-1003724596514:17)
and forward it to _send_to_platform and mirror_to_session.

Previously _resolve_delivery_target() always set thread_id=None when
parsing the platform:chat_id format, breaking cron job delivery to
specific Telegram topics.

Added tests:
- test_explicit_telegram_topic_target_with_thread_id
- test_explicit_telegram_chat_id_without_thread_id

Also updated CRONJOB_SCHEMA deliver description to document the
platform:chat_id:thread_id format.

Co-authored-by: Alex Ferrari <alex@thealexferrari.com>
aashizpoudel pushed a commit to aashizpoudel/hermes-agent that referenced this pull request Mar 30, 2026
…d_id format (NousResearch#2455)

Parse thread_id from explicit deliver target (e.g. telegram:-1003724596514:17)
and forward it to _send_to_platform and mirror_to_session.

Previously _resolve_delivery_target() always set thread_id=None when
parsing the platform:chat_id format, breaking cron job delivery to
specific Telegram topics.

Added tests:
- test_explicit_telegram_topic_target_with_thread_id
- test_explicit_telegram_chat_id_without_thread_id

Also updated CRONJOB_SCHEMA deliver description to document the
platform:chat_id:thread_id format.

Co-authored-by: Alex Ferrari <alex@thealexferrari.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants