Bug Description
When sessions_send triggers the announce step for a Telegram group topic session, the delivery fails with:
Error: Telegram recipient must be a numeric chat ID
Root Cause
resolveAnnounceTargetFromKey() parses the sessionKey agent:<name>:telegram:group:<chatId>:topic:<topicId> and generates to: "group:<chatId>".
However, normalizeTelegramLookupTarget() → stripTelegramInternalPrefixes() only strips the group: prefix if preceded by telegram: or tg:.
Since the announce target comes without that prefix, group: is NOT stripped, and group:-1003743251787 fails the numeric chat ID regex check.
Expected Behavior
Announce step should deliver agent response to the Telegram group topic.
Actual Behavior
Gateway log:
[ws] res send errorCode=UNAVAILABLE errorMessage=Error: Telegram recipient must be a numeric chat ID channel=telegram
[agents/sessions-send] sessions_send announce delivery failed
Suggested Fix
In resolveAnnounceTargetFromKey(), apply Telegram normalizeTarget on the to field, or update stripTelegramInternalPrefixes() to always strip group: prefix regardless.
Workaround
Agents post via Bot API directly using notify-topic.sh.
Environment
- OpenClaw 2026.3.13 (61d171a)
- Ubuntu 24.04 LTS
Bug Description
When
sessions_sendtriggers the announce step for a Telegram group topic session, the delivery fails with:Root Cause
resolveAnnounceTargetFromKey()parses the sessionKeyagent:<name>:telegram:group:<chatId>:topic:<topicId>and generatesto: "group:<chatId>".However,
normalizeTelegramLookupTarget()→stripTelegramInternalPrefixes()only strips thegroup:prefix if preceded bytelegram:ortg:.Since the announce target comes without that prefix,
group:is NOT stripped, andgroup:-1003743251787fails the numeric chat ID regex check.Expected Behavior
Announce step should deliver agent response to the Telegram group topic.
Actual Behavior
Gateway log:
Suggested Fix
In
resolveAnnounceTargetFromKey(), apply TelegramnormalizeTargeton thetofield, or updatestripTelegramInternalPrefixes()to always stripgroup:prefix regardless.Workaround
Agents post via Bot API directly using
notify-topic.sh.Environment