fix(telegram): scope skill commands to bound agent per bot #4360
+5
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
registerTelegramNativeCommands()callslistSkillCommandsForAgents({ cfg })without passingagentIds, so every Telegram bot registers all agents' skill commandsusedSet causes de-duplication suffixes (/butler_2,/housekeeper_2)BOT_COMMANDS_TOO_MUCHerrorsThis fix passes the bound agent's ID to
listSkillCommandsForAgents()so each Telegram bot only registers its own agent's skill commands. The function already acceptsagentIds— it just wasn't wired from the Telegram path.What changed
One file:
src/telegram/bot-native-commands.tsresolveAgentRouteis already imported (line 25) andaccountIdis already a parameter ofregisterTelegramNativeCommands.Before/After
/butler,/butler_2on both bots/butleron each bot (scoped)BOT_COMMANDS_TOO_MUCHTesting
park-rob,park-kyla) sharing 6 workspace skillsBOT_COMMANDS_TOO_MUCHerrors/housekeeperand/butlerinvoke correctly on the bound agent's botboundRoute.agentIdis undefined,agentIdsdefaults to all)AI Disclosure
🤖 AI-assisted (Claude Opus 4.5). The root cause was identified by tracing the code path from
registerTelegramNativeCommands→listSkillCommandsForAgents→ sharedusedSet. The fix was tested on a production multi-agent Clawdbot instance before submitting.