I had opened a feature request for having 2 configuration channels for a heartbeat... the thinking channel and the contact channel that could be telegram.
Something automatic instead of using prompts to direct the agent when and how to contact you... but they said this is already available. But I cannot find (or understand?) how to configure. Any guidance would be appreciated.
#Heartbeat only reply to other session/ (telegram) channel when it has something to say.
1 messages · Page 1 of 1 (latest)
Yep, this is available now. The split is:
- thinking/run context =
agents.defaults.heartbeat.session - contact/delivery channel =
agents.defaults.heartbeat.target+ optionalto
So for “run the heartbeat against some existing session, but only message me on Telegram when there is something worth saying”, the shape is:
{
agents: {
defaults: {
heartbeat: {
every: "30m",
// Optional: make the heartbeat think in a specific existing session.
// Copy the exact key from: openclaw sessions --json
session: "agent:main:discord:...",
// Deliver outward messages to Telegram.
target: "telegram",
to: "123456789", // Telegram chat id, or "-1001234567890:topic:42" for a topic
// Optional, but useful if this only needs HEARTBEAT.md context:
lightContext: true
}
}
},
channels: {
telegram: {
enabled: true,
botToken: "YOUR_TELEGRAM_BOT_TOKEN",
// These are the important defaults for “only say something when needed”.
heartbeat: {
showOk: false,
showAlerts: true
}
}
}
}
The “only reply when it has something to say” part is handled by the heartbeat response contract: if there’s nothing to report, the agent should reply HEARTBEAT_OK. OpenClaw strips/drops that by default because showOk is false. If there is an alert, it should return the alert text without HEARTBEAT_OK, and that gets sent to Telegram.
A couple of practical notes:
target: "none"means “run internally, deliver nowhere”.
target: "last"sends to the last external contact for that session.target: "telegram"+tois the explicit Telegram route.- If you use multiple Telegram bot accounts, add
accountIdunder the heartbeat block. - Telegram topics use
<chatId>:topic:<messageThreadId>.
Docs:
https://docs.openclaw.ai/gateway/heartbeat
https://docs.openclaw.ai/channels/telegram
If it doesn’t behave this way on your machine, first check openclaw --version; heartbeat delivery routing has moved around a bit, so version matters here.