fix(cron): support Telegram topic/thread ID in delivery target#474
fix(cron): support Telegram topic/thread ID in delivery target#474mitschabaude-bot wants to merge 1 commit intoopenclaw:mainfrom
Conversation
When delivering cron job output to Telegram, the 'to' field now supports specifying a topic (forum thread) ID in addition to the chat ID. Supported formats: - chatId (plain chat ID or @username) - chatId:topicId (chat ID with numeric topic ID) - chatId:topic:topicId (alternative format with explicit marker) This enables cron jobs to deliver messages to specific forum topics rather than always going to the main/general topic. Adds parseTelegramTarget helper function with unit tests.
|
thanks! |
|
context: I follow this TG channel pattern: https://x.com/nachoiacovino/status/2008571909584392547 asked my clawd to notify me on heartbeats, but it ended up posting in the general channel instead of the dedicated one |
|
Nice fix + tests. One big bug though: cron often uses lastTo like |
|
Landed on main (with fixes) — thanks @mitschabaude-bot!\n\n- Preserved original author in git graph: 2afb75d (cherry-pick of 24a6595)\n- Fix: handle internal prefixes like |
…eway
Replace bare KeepAlive=true with { SuccessfulExit: true } in the
LaunchAgent plist. This makes launchd only restart the gateway on a
crash exit, not when it is intentionally stopped by the App's
GatewayLaunchAgentManager or by a kickstart -k call.
Also add ThrottleInterval=5 to prevent exponential backoff from
compressing rapid crash/restart cycles.
Audit changes:
- launchd-keep-alive now flags any plist that does NOT have the
KeepAlive { SuccessfulExit: true } dict form (including old true plists)
- New launchd-throttle-interval audit code flags plists missing
ThrottleInterval=5
Tests (28 pass):
- buildLaunchAgentPlist produces SuccessfulExit dict + ThrottleInterval=5
- installLaunchAgent writes plist with new KeepAlive form
- auditGatewayServiceConfig (darwin) flags legacy KeepAlive=true + missing
ThrottleInterval as issues
- auditGatewayServiceConfig (darwin) accepts new-format plists cleanly
Closes openclaw#20257 (migrated as Workshop task openclaw#474)
* Add Russian language * Add Russian language * Clean up hidden Unicode characters in Russian translation * add languages.ts * add some missing translations --------- Co-authored-by: CJ Pais <cj@cjpais.com>
Summary
When delivering cron job output to Telegram, the
tofield now supports specifying a topic (forum thread) ID in addition to the chat ID.Problem
Cron jobs configured to deliver to Telegram groups with forum topics always sent messages to the main/general topic, even when a topic ID was specified in the
tofield. The topic portion was not being parsed, andmessageThreadIdwas not passed to the send function.Solution
Added a
parseTelegramTarget()helper that extracts bothchatIdand optionaltopicIdfrom the delivery target string.Supported formats:
chatId— plain chat ID or @usernamechatId:topicId— chat ID with numeric topic ID (e.g.,-1001234567890:123)chatId:topic:topicId— alternative format with explicit markerThe parsed
topicIdis then passed asmessageThreadIdtosendMessageTelegram().Testing
parseTelegramTarget()covering all formats