Skip to content

[Bug]: cron isolated agentTurn with delivery.mode=announce posts duplicate messages with different content (extra agent run triggered) #15692

@su79eu7k

Description

@su79eu7k

Environment

• OpenClaw: 2026.2.12 (also reproduced on 2026.2.9)
• OS: Raspberry Pi OS / Linux 6.12.34+rpt-rpi-2712 (arm64)
• Node: 22.22.0
• Channel: Telegram (bot)
• Gateway bind: loopback (ws://127.0.0.1:18789)
• session.dmScope: per-channel-peer
What I expected

• For an isolated cron job (sessionTarget=isolated, payload.kind=agentTurn) using default delivery/announce: • Job runs once
• Exactly one Telegram message is delivered (the job output or summary)
• No extra agent run is triggered outside the cron run session

What happened

• The cron job run executes once (cron runs history shows a single run), but two Telegram messages are delivered to the same chat, and their contents differ (indicating multiple LLM generations).
• Logs show that after the cron run session (cron: runId), an additional agent run starts under the main session (agent:main:main, sessionId like d30eff...) and/or a messageChannel=cron-event run triggers, resulting in duplicate output.
Repro steps (minimal)

  1. Create an isolated one-shot cron job scheduled a few minutes in the future with payload.kind=agentTurn.
  2. Do not call message tool inside the prompt. Only output text.
  3. Use delivery default (omit delivery) or explicitly set:
"delivery": { "mode": "announce", "channel": "telegram", "to": "<your-chat-id>" }
  1. Wait for execution.
  2. Observe: two messages delivered; content differs.
    Example job payload
{
  "schedule": { "kind": "at", "at": "2026-02-13T13:39:34.885Z" },
  "sessionTarget": "isolated",
  "wakeMode": "now",
  "payload": {
    "kind": "agentTurn",
    "timeoutSeconds": 120,
    "message": "[TEST] Fetch and summarize in <=3 lines.\nhttps://api.open-meteo.com/v1/forecast?latitude=37.537&longitude=127.072&current=apparent_temperature,wind_speed_10m,wind_gusts_10m&timezone=Asia%2FSeoul\n(Important) Do not use message tool; output only."
  },
  "delivery": { "mode": "announce", "channel": "telegram", "to": "<chat-id>" }
}

Evidence / notes

• cron runs shows a single finished ok entry for the job.
• Yet multiple embedded run start events occur: • One runId under sessionId= with messageChannel=telegram (expected cron run)
• Additional runId under sessionId= (e.g., d30eff...) with messageChannel=telegram shortly after (unexpected)
• Sometimes an extra messageChannel=cron-event run also appears

• This seems to contradict docs claim that “announce delivers directly via outbound channel adapters; main agent is not spun up to craft or forward the message” (docs: /automation/cron-jobs, “Announce delivery flow” section).
Workaround

• Set delivery.mode="none" and explicitly send exactly one message via message tool to a fixed Telegram target. • This reliably results in a single message.

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