openclaw/src/telegram
robhparker c6ddc95fc0 fix(telegram): scope skill commands to bound agent per bot
registerTelegramNativeCommands() calls listSkillCommandsForAgents()
without passing agentIds, causing ALL agents' skill commands to be
registered on EVERY Telegram bot. When multiple agents share skill
names (e.g. two agents both have a "butler" skill), the shared `used`
Set in listSkillCommandsForAgents causes de-duplication suffixes
(_2, _3) and all commands appear on every bot regardless of agent
binding.

This fix uses the existing resolveAgentRoute() (already imported) to
find the bound agent for the current Telegram accountId, then passes
that agentId to listSkillCommandsForAgents(). The function already
accepts an optional agentIds parameter — it just wasn't wired from
the Telegram registration path.

Before: All agents' skill commands registered on every Telegram bot,
causing /butler_2, /housekeeper_2 dedup suffixes and potential
BOT_COMMANDS_TOO_MUCH errors when total exceeds 100.

After: Each Telegram bot only registers skill commands for its own
bound agent. No cross-agent dedup, no command limit overflow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 11:58:23 +05:30
..
bot refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
accounts.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
accounts.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
allowed-updates.ts fix: refine telegram reactions (#964) (thanks @bohdanpodvirnyi) 2026-01-15 17:20:17 +00:00
api-logging.ts telegram: centralize api error logging 2026-01-26 20:27:36 -06:00
audit.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
audit.ts fix: normalize gateway dev mode detection 2026-01-18 01:08:47 +00:00
bot-access.ts fix: stabilize ci checks 2026-01-19 00:34:26 +00:00
bot-handlers.ts fix: land /help + /commands formatting (#2504) (thanks @hougangdev) 2026-01-27 02:43:14 -05:00
bot-message-context.dm-threads.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot-message-context.sender-prefix.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot-message-context.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot-message-dispatch.ts fix: avoid silent telegram empty replies (#3796) (#3796) 2026-01-29 11:34:47 +05:30
bot-message.test.ts fix: emit diagnostics across channels 2026-01-21 00:30:34 +00:00
bot-message.ts fix: emit diagnostics across channels 2026-01-21 00:30:34 +00:00
bot-native-commands.plugin-auth.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot-native-commands.ts fix(telegram): scope skill commands to bound agent per bot 2026-01-30 11:58:23 +05:30
bot-updates.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
bot.create-telegram-bot.accepts-group-messages-mentionpatterns-match-without-botusername.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.applies-topic-skill-filters-system-prompts.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.blocks-all-group-messages-grouppolicy-is.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.dedupes-duplicate-callback-query-updates-by-update.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.installs-grammy-throttler.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.matches-tg-prefixed-allowfrom-entries-case-insensitively.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.matches-usernames-case-insensitively-grouppolicy-is.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.routes-dms-by-telegram-accountid-binding.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.create-telegram-bot.sends-replies-without-native-reply-threading.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.media.downloads-media-file-path-no-file-download.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.media.includes-location-text-ctx-fields-pins.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
bot.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
caption.ts refactor: share telegram caption splitting 2026-01-17 03:50:09 +00:00
download.test.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
download.ts Fix text attachment MIME misclassification (#3628) 2026-01-29 02:33:03 +00:00
draft-chunking.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
draft-chunking.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
draft-stream.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
fetch.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
fetch.ts Telegram: harden network retries and config 2026-01-26 19:36:43 -05:00
format.test.ts fix: telegram html formatting (#435, thanks @RandyVentures) 2026-01-08 02:34:32 +01:00
format.ts fix: render Telegram media captions 2026-01-24 03:39:25 +00:00
group-migration.test.ts fix(telegram): migrate group config on supergroup IDs (#906) 2026-01-15 01:10:30 +00:00
group-migration.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
index.ts feat: unify provider reaction tools 2026-01-07 04:16:39 +01:00
inline-buttons.test.ts refactor: prune legacy group targets 2026-01-17 09:01:47 +00:00
inline-buttons.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
monitor.test.ts Telegram: harden network retries and config 2026-01-26 19:36:43 -05:00
monitor.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
network-config.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
network-config.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
network-errors.test.ts fix: handle Telegram network errors gracefully to prevent gateway crashes 2026-01-27 19:56:24 -06:00
network-errors.ts fix: handle Telegram network errors gracefully to prevent gateway crashes 2026-01-27 19:56:24 -06:00
pairing-store.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
pairing-store.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
probe.ts fix: normalize gateway dev mode detection 2026-01-18 01:08:47 +00:00
proxy.ts fix: normalize abort signals for telegram fetch 2026-01-21 16:46:58 +00:00
reaction-level.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
reaction-level.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
send.caption-split.test.ts Telegram: harden network retries and config 2026-01-26 19:36:43 -05:00
send.edit-message.test.ts feat(telegram): add edit message action (#2394) (thanks @marcelomar21) 2026-01-26 15:34:47 -08:00
send.preserves-thread-params-plain-text-fallback.test.ts Telegram: harden network retries and config 2026-01-26 19:36:43 -05:00
send.proxy.test.ts Telegram: harden network retries and config 2026-01-26 19:36:43 -05:00
send.returns-undefined-empty-input.test.ts feat(telegram): add sticker support with vision caching 2026-01-27 12:47:23 +05:30
send.ts feat: Add support for Telegram quote (partial message replies) (#2900) 2026-01-27 15:59:24 -05:00
sent-message-cache.test.ts fix: lint errors 2026-01-15 17:07:38 +00:00
sent-message-cache.ts fix: lint errors 2026-01-15 17:07:38 +00:00
sticker-cache.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
sticker-cache.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
targets.test.ts refactor: prune legacy group targets 2026-01-17 09:01:47 +00:00
targets.ts refactor: prune legacy group targets 2026-01-17 09:01:47 +00:00
token.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
token.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
update-offset-store.test.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
update-offset-store.ts chore: migrate to oxlint and oxfmt 2026-01-14 15:02:19 +00:00
voice.test.ts refactor: consolidate reply/media helpers 2026-01-10 02:41:16 +01:00
voice.ts refactor: unify inline directives and media fetch 2026-01-10 03:01:04 +01:00
webhook-set.ts telegram: centralize api error logging 2026-01-26 20:27:36 -06:00
webhook.test.ts fix: refine telegram reactions (#964) (thanks @bohdanpodvirnyi) 2026-01-15 17:20:17 +00:00
webhook.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00