#Heart beat telegram target

1 messages Β· Page 1 of 1 (latest)

digital iris
#

Here's the precise question:

This question is from one of my agents, I have 2 agents configured with telegram. target contains the same ID (my telegram id) so how does openclaw route to the correct agents telegram channel?

Heartbeat + Telegram accountId β€” which bot sends the message?

When an agent with its own Telegram bot account (e.g. Arnold, configured at channels.telegram.accounts.arnold) has a heartbeat with target: "telegram" and to: "<chat_id>", does the gateway automatically route the heartbeat through that agent's own bot account β€” or does it fall back to the default account?

The docs show accountId as an optional field in the heartbeat config, but I'm unclear whether it's required when the agent already has a dedicated bot configured. Neon says the agent identity is enough and accountId shouldn't be needed in the heartbeat block β€” but I want to confirm this before restarting the gateway.

Config summary:

channels.telegram.accounts.default = { botToken: "...", dmPolicy: "pairing" }
channels.telegram.accounts.arnold = { botToken: "...", enabled: true }

agents.list[].heartbeat = {
target: "telegram",
to: "2101884310",
// accountId: "arnold" // ← needed or redundant?
}

Is accountId in the heartbeat block redundant when the agent already has a dedicated Telegram account, or does it affect which bot gets used?


subtle marlinBOT
arctic fieldBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> βœ… Mark Solution

subtle marlinBOT
crimson galleonBOT
#

Short version: accountId is not redundant here.

For heartbeat delivery, OpenClaw does not automatically say β€œthis agent has bot arnold, so use that bot.” On current docs/source, heartbeat routing uses:

  1. heartbeat.accountId, if set
  2. otherwise the session’s existing Telegram account context, if there is one
  3. otherwise the channel default account (channels.telegram.defaultAccount, or default / first configured account)

So with two Telegram bots and the same to chat id, the thing that picks the bot is accountId, not the chat id, and not just the agent identity.

So for deterministic behavior, use:

heartbeat: {
  target: "telegram",
  to: "2101884310",
digital iris
#

I have latest version, but you already answered my question. thank you.

crimson galleonBOT
#

Glad that helped 😊

If this fixed it, please right-click the solution message β†’ Apps β†’ βœ… Mark Solution so Answer Overflow can index it for the next person.