Skip to content

[Bug]: Multi-agent Telegram: /new command sends "New session started" to wrong bot #2537

@sam55silver

Description

@sam55silver

Summary

When running multiple Telegram bot accounts bound to different agents, the /new command sends the "New session started" confirmation message via the wrong bot. The native command handler in bot-native-commands.ts creates a context without AccountId, causing the reply to fall back to the first/default account instead of the one that received the command.

Steps to reproduce

  1. Configure two Telegram accounts with different bot tokens, each bound to a different agent
  2. Start the gateway with both bots running
  3. Send /new to bot A

Expected behavior

The "✅ New session started" message appears in the chat with bot A (the bot that received the /new command).

Actual behavior

The "✅ New session started" message appears in the chat with bot B (a different bot).

Environment

  • Clawdbot version: 2026.1.25
  • OS: Linux (Debian 13)
  • Install method: pnpm (local dev)

Logs or screenshots

Debug trace showing accountId=undefined when sending the reset confirmation:
[DEBUG reset] channel=telegram to=telegram:8368358784 accountId=undefined sessionKey=agent:sam-silver:main
[DEBUG send] opts.accountId=undefined resolved.accountId=eugene-silver resolved.tokenSource=config

Fix

Root cause: src/telegram/bot-native-commands.ts line ~444 creates context without AccountId. Fix is to add AccountId: route.accountId to the context payload, matching how bot-message-context.ts handles regular messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions