#Heartbeat only reply to other session/ (telegram) channel when it has something to say.

1 messages · Page 1 of 1 (latest)

lone hazel
#

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.

toxic thicketBOT
#

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

wild caveBOT
# lone hazel I had opened a feature request for having 2 configuration channels for a heartbe...

Yep, this is available now. The split is:

  • thinking/run context = agents.defaults.heartbeat.session
  • contact/delivery channel = agents.defaults.heartbeat.target + optional to

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
wild caveBOT
wild caveBOT
# lone hazel I had opened a feature request for having 2 configuration channels for a heartbe...
      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”.
wild caveBOT
# lone hazel I had opened a feature request for having 2 configuration channels for a heartbe...
  • target: "last" sends to the last external contact for that session.
  • target: "telegram" + to is the explicit Telegram route.
  • If you use multiple Telegram bot accounts, add accountId under 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.