Skip to content

[Bug] Cron delivery.announce marks messages as delivered even when Telegram API fails #27069

@hong418884611

Description

@hong418884611

Bug Description

Cron jobs with delivery.announce mark messages as delivered: true even when Telegram API fails to send the message. This results in:

  • ✅ Cron job status shows delivered: true
  • deliveryStatus: "delivered"
  • ❌ User receives no message in Telegram
  • ⚠️ Logs show Telegram API errors: telegram sendChatAction failed: Network request failed!

Expected Behavior

When a cron job's delivery.announce fails:

  • ❌ Mark as delivered: false
  • ❌ Set deliveryStatus: "failed" or "error"
  • ✅ Retry or report the error

Current Behavior

From /tmp/openclaw-0/openclaw-2026-02-26.log:

{
  "ts": 1772071250225,
  "jobId": "5803682f-1c92-402a-8455-d1ef804122ff",
  "action": "finished",
  "status": "ok",
  "summary": "🔔 提醒:2月26日退税任务还没完成哦!...",
  "delivered": true,
  "deliveryStatus": "delivered"
}

But simultaneously in logs:

{"subsystem":"telegram/api"} telegram sendChatAction failed: Network request for 'sendChatAction' failed!

Impact

  • Users miss critical reminders (e.g., tax refund deadline)
  • No visibility into delivery failures
  • Cannot distinguish between "sent successfully" and "marked as sent but failed"

Environment

  • OpenClaw version: 2026.2.24
  • Gateway mode: local
  • Delivery mode: announce
  • Channel: Telegram
  • Node version: v24.13.1 (via NVM)

Reproduction

  1. Create a cron job with delivery.announce:
{
  "delivery": {
    "mode": "announce",
    "channel": "telegram",
    "to": "8378459833"
  }
}
  1. Trigger network issues or Telegram API failures
  2. Check cron run logs - shows delivered: true even when failed
  3. Check Gateway logs - shows Telegram API errors

Additional Context

  • Manual message sending via message tool works fine
  • Gateway is running (pid 19404)
  • Telegram bot token is valid
  • Only cron delivery.announce has this issue

Suggested Fix

The delivery mechanism should:

  1. Properly catch and handle Telegram API errors
  2. Mark jobs as delivered: false when API calls fail
  3. Optionally implement retry logic
  4. Log delivery errors clearly (not just in subsystem logs)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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