Skip to content

Cron delivery to webchat hijacks main session deliveryContext, causing message loss #21834

@Riyaz-Patel

Description

@Riyaz-Patel

Bug Description

When a cron job with delivery: { mode: "announce", channel: "webchat" } fires, it overwrites the main session's deliveryContext and origin fields with heartbeat/cron metadata. This causes subsequent user messages on webchat to be lost or routed incorrectly.

Steps to Reproduce

  1. Have an active webchat session with a user
  2. Configure a cron job with:
    { "sessionTarget": "isolated", "delivery": { "mode": "announce", "channel": "webchat" } }
  3. Wait for the cron to fire
  4. Send messages from the webchat client

Expected Behavior

The cron announce should deliver into the existing webchat session without modifying its deliveryContext or origin. User messages sent after the cron should continue to work normally.

Actual Behavior

After the cron fires, the session's deliveryContext is overwritten:

{
  "deliveryContext": { "channel": "webchat", "to": "heartbeat" },
  "origin": { "label": "heartbeat", "from": "heartbeat", "to": "heartbeat" }
}

Messages sent by the user after this point are lost — they don't appear in any session log and no response is delivered back to the webchat client.

Impact

  • Message loss: User messages disappear entirely (not in any session log)
  • Silent failure: No error shown to the user; messages just vanish
  • Cron delivery also reports (error) with "cron delivery target is missing", suggesting webchat delivery without an explicit to is not fully supported

Workaround

Use a different delivery channel (e.g. Telegram) instead of webchat for cron announces.

Environment

  • OpenClaw v2026.2.12
  • Channel: webchat
  • OS: Linux (Ubuntu)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    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