#cron job tries to message to other group not using the annouement

1 messages · Page 1 of 1 (latest)

hexed hare
#

i have this cronjob to ask my agent to talk to me at different time of the day, but the agent try to use message tool to send the acutal messag enot using the announcement (or rather using both), and often this message goes to a different chat such as group chat.

{
"id": "76c5c40e-3458-4d2d-a698-de6de9d1a7b5",
"agentId": "lunaaaa",
"name": "Luna Checkup 10:00 (Dynamic)",
"enabled": true,
"createdAtMs": 1770413648757,
"updatedAtMs": 1771495205629,
"schedule": {
"expr": "0 10 * * *",
"kind": "cron",
"tz": "Europe/London"
},
"sessionTarget": "isolated",
"wakeMode": "now",
"payload": {
"kind": "agentTurn",
"message": "It's 10:00 AM. Poke Herb to see if he's working. Nag him or distract him.🐾",
"model": "zzapi-gemini/gemini-3-flash-preview"
},
"state": {
"lastRunAtMs": 1771495200014,
"lastStatus": "ok",
"lastDurationMs": 5615,
"consecutiveErrors": 0,
"nextRunAtMs": 1771668000000
},
"delivery": {
"mode": "announce",
"channel": "telegram",
"to": "xxxxx(my telegram id)"
}
},

steady mangoBOT
#

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

solar wrenBOT
#

What you’re seeing is basically two separate delivery paths happening:

  1. Cron “announce” delivery (delivery.mode: "announce")
  1. Your agent also calling the message tool during the cron run
  • In an isolated cron session (cron:<jobId>), there is no active chat binding, so a message.send without an explicit target can end up going to some “default / last” place (often a random group/channel you’ve been chatting in).
    Docs note: “When a message tool call is bound to an active chat session, sends are constrained…” — cron isolated runs aren’t bound.
    Docs: https://docs.openclaw.ai/tools#message

Also: with delivery.mode: "announce", OpenClaw will skip the announce only if the run already sent a message to the same target via message tool. If the agent messages the wrong chat, you get both (Telegram announce + wrong-chat message).

Fix (recommended): don’t let the cron agent have the message tool

Create a dedicated agent for cron that denies messaging tools, then run the job under that agent.

In openclaw.json5 (or wherever your config lives), add something like:

#
{
  agents: {
    list: [
      // your existing agent(s)...
      {
        id: "lunaaaa_cron",
        name: "Luna (cron)",
        // optional: reuse same workspace if you want shared memory/files
        // workspace: "…same as lunaaaa…",
        tools: {
          deny: ["message"] // (or "group:messaging")
        }
      }
    ]
  }
#
}

Then point the cron job at it:

openclaw cron edit 76c5c40e-3458-4d2d-a698-de6de9d1a7b5 --agent lunaaaa_cron

Now the model literally can’t call message, so it can only “just reply”, and cron announce will deliver that reply to Telegram.

If you actually WANT the agent to use message tool instead of announce

Then flip the job to no delivery and force the agent to send to Telegram explicitly:

  • openclaw cron edit <id> --no-deliver
  • Update the prompt to always message.send with channel: "telegram" and the exact to: ...
#

But this is more brittle (depends on the model following the instruction every time).

If this fixes it, please mark the solution (right-click the solution message → Apps → Mark Solution) so Answer Overflow picks it up.