mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(cron): support Telegram topic delivery via platform:chat_id:thread_id format (#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>
This commit is contained in:
parent
57d3ac0c0b
commit
89befcaf33
3 changed files with 30 additions and 3 deletions
|
|
@ -62,6 +62,28 @@ class TestResolveDeliveryTarget:
|
|||
"thread_id": "17585",
|
||||
}
|
||||
|
||||
def test_explicit_telegram_topic_target_with_thread_id(self):
|
||||
"""deliver: 'telegram:chat_id:thread_id' parses correctly."""
|
||||
job = {
|
||||
"deliver": "telegram:-1003724596514:17",
|
||||
}
|
||||
assert _resolve_delivery_target(job) == {
|
||||
"platform": "telegram",
|
||||
"chat_id": "-1003724596514",
|
||||
"thread_id": "17",
|
||||
}
|
||||
|
||||
def test_explicit_telegram_chat_id_without_thread_id(self):
|
||||
"""deliver: 'telegram:chat_id' sets thread_id to None."""
|
||||
job = {
|
||||
"deliver": "telegram:-1003724596514",
|
||||
}
|
||||
assert _resolve_delivery_target(job) == {
|
||||
"platform": "telegram",
|
||||
"chat_id": "-1003724596514",
|
||||
"thread_id": None,
|
||||
}
|
||||
|
||||
def test_bare_platform_uses_matching_origin_chat(self):
|
||||
job = {
|
||||
"deliver": "telegram",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue