mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-27 06:11:40 +00:00
fix(send_message): normalize Telegram General topic thread_id + add Slack thread_ts
Addresses two review findings from Codex: 1. telegram:current breaks in forum General — the gateway synthesizes thread_id='1' for the General topic, but the Bot API rejects message_thread_id=1. Strip it to None in _resolve_current_session_target(), matching TelegramAdapter._message_thread_id_for_send(). 2. slack:current drops thread context — _send_slack() never received thread_id and posted chat.postMessage without thread_ts, so messages landed in channel root instead of the active thread. Add thread_id param and forward it as thread_ts when present. Tests: 4 new cases (Telegram General normalization, real topic preserved, Slack thread_ts included, Slack thread_ts absent). 84 passed total.
This commit is contained in:
parent
c559c66236
commit
3d2b8d0acf
2 changed files with 13 additions and 2 deletions
|
|
@ -1900,6 +1900,7 @@ class TestSendMessageCurrentSessionTarget:
|
|||
)
|
||||
|
||||
assert result["success"] is True
|
||||
# thread_id must be None (stripped), not "1"
|
||||
send_mock.assert_awaited_once_with(
|
||||
Platform.TELEGRAM,
|
||||
telegram_cfg,
|
||||
|
|
@ -1970,6 +1971,7 @@ class TestSendSlackThreadId:
|
|||
)
|
||||
|
||||
assert result["success"] is True
|
||||
# Verify thread_ts was in the JSON payload
|
||||
call_kwargs = mock_session.post.call_args
|
||||
payload = call_kwargs.kwargs.get("json") or call_kwargs[1].get("json")
|
||||
assert payload["thread_ts"] == "1712345678.1234"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue