Skip to content

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

Merged
teknium1 merged 1 commit into
mainfrom
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 into
mainfrom
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>
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 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>
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 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>
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 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>
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants