Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Chloe-VP
Copy link
Contributor

Problem

When running multiple Clawdbot agents with the same Telegram bot token (multi-agent setup), native commands like /start were not being routed to the correct agent. The AccountId was not being passed through the command context, causing the routing logic to fail.

Solution

Added AccountId to the context object passed to native command handlers in the Telegram channel plugin. This ensures multi-agent routing works correctly for native commands, consistent with how regular messages are handled.

Changes

  • src/channels/telegram/telegram-plugin.ts: Include AccountId in the context object passed to handleNativeCommand()

Testing

Tested in a multi-agent environment where two agents share the same Telegram bot token. Native commands now route correctly to the appropriate agent based on AccountId.

@moltbot-barnacle moltbot-barnacle bot added the channel: telegram Channel integration: telegram label Jan 27, 2026
@sam55silver
Copy link

Great change! +1 for merging this. Would help out lots.

@obviyus obviyus self-assigned this Jan 29, 2026
Chloe-VP and others added 2 commits January 29, 2026 10:11
…agent routing

When running multiple Telegram bot accounts bound to different agents,
the /new command (and other slash commands) would send confirmation
messages via the wrong bot because the context was missing AccountId.

The fix adds AccountId: route.accountId to the context payload in
registerTelegramNativeCommands, matching how bot-message-context.ts
handles regular messages.

Fixes openclaw#2537
@obviyus obviyus force-pushed the fix/telegram-multi-agent-accountid branch from 51d83bd to 0319bef Compare January 29, 2026 04:47
@obviyus obviyus merged commit fcc53bc into openclaw:main Jan 29, 2026
20 of 21 checks passed
@obviyus
Copy link
Contributor

obviyus commented Jan 29, 2026

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: 0319bef
  • Merge commit: fcc53bc

Thanks @Chloe-VP!

lawrence565 pushed a commit to lawrence565/moltbot that referenced this pull request Jan 29, 2026
HirokiKobayashi-R pushed a commit to HirokiKobayashi-R/moltbot that referenced this pull request Jan 29, 2026
mfgering pushed a commit to mfgering/mfg_moltbot that referenced this pull request Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants