← Back to PRs

#11240: Fix #10875: Clear Telegram commands before registering to prevent duplicates

by divol89 open 2026-02-07 16:09 View on GitHub →
channel: signal channel: telegram app: web-ui gateway cli agents stale
## Problem When `commands.nativeSkills` is set to "auto", Telegram skill commands are registered multiple times on gateway restart. Each skill appears 5 times with suffixes like `_2`, `_3`, etc. ## Root Cause The Telegram API endpoint `setMyCommands` appends commands rather than replacing them across gateway restarts, causing duplicates to accumulate. ## Fix Call `deleteMyCommands` before `setMyCommands` to clear the existing command list before registering fresh commands. ## Changes - Added `deleteMyCommands` call before `setMyCommands` in `src/telegram/bot-native-commands.ts` Fixes #10875 Wallet: BYCgQQpJT1odaunfvk6gtm5hVd7Xu93vYwbumFfqgHb3 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR primarily addresses Telegram native command duplication across gateway restarts by clearing existing bot commands before re-registering them (`deleteMyCommands` before `setMyCommands`). It also includes a set of related fixes/enhancements across cron scheduling, memory backend fallback behavior, Signal inbound handling, TTS config, and UI markdown rendering performance. One correctness issue was found in the Signal edit handling: edited messages can end up with a `messageId` of `"NaN"` if the edit target timestamp is not parseable, which can break deduplication/downstream indexing. <h3>Confidence Score: 4/5</h3> - Mostly safe to merge once the Signal edit messageId handling is fixed. - Changes are generally straightforward and localized, but Signal edit handling can generate a non-unique `messageId` ("NaN") for certain inputs, which is likely to break deduplication/indexing for edited messages. - src/signal/monitor/event-handler.ts <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs