Skip to content

delivery-recovery flushes stale pending messages as batch on every restart #55231

Closed as not planned

Description

@coolmanns

Summary

When the gateway restarts (for any reason), delivery-recovery flushes ALL pending delivery entries at once. This causes stale transcript echo messages — sometimes hours old — to arrive as a batch in the user's chat, making it look like the bot is spamming.

Reproduction

Observed on v2026.3.24 stable. Happens on every restart, including health-monitor triggered crashes.

Latest repro (2026-03-26 09:53 CDT):

  1. Discord health-monitor detects stale socket, triggers restart
  2. Gateway crashes (see #TBD for the crash bug), systemd restarts it (restart counter: 39)
  3. On startup, delivery-recovery finds 5 pending entries
  4. All 5 flushed to Telegram within ~2 seconds
  5. User receives a batch of old transcript echo messages

Previous occurrence (2026-03-25 ~14:43 CDT): 10 pending entries batch-flushed after gateway restart.

[delivery-recovery] Found 5 pending delivery entries — starting recovery
[delivery-recovery] Recovered delivery fe593ca0... to telegram:...
[delivery-recovery] Recovered delivery 0ca55964... to telegram:...
[delivery-recovery] Recovered delivery 4a0defdc... to telegram:...
[delivery-recovery] Recovered delivery adfb47bb... to telegram:...
[delivery-recovery] Recovered delivery cbd9d8d9... to telegram:...
[delivery-recovery] Delivery recovery complete: 5 recovered, 0 failed

Expected behavior

  • Pending entries older than a configurable threshold (e.g. 5 minutes) should be silently discarded or logged-only, not delivered
  • Transcript echo / confirmation messages should never be queued for delivery-recovery in the first place — they are ephemeral notifications, not critical user messages

Environment

  • OpenClaw v2026.3.24 stable
  • Ubuntu, systemd service
  • Channels: Telegram + Discord

Activity

  1. openclaw-clownfish commented on Apr 29, 2026

    @openclaw-clownfish
    Contributor

    Thanks for this. I am closing this as a duplicate of #55564 because both reports track the same gateway delivery-recovery root cause: on restart, stale pending delivery entries are flushed together instead of being filtered by age or replay policy.

    I am keeping #55564 open as the canonical thread so fixes, validation, and follow-up stay in one place. Your v2026.3.24 restart and recovery logs are useful evidence for that thread. If this has a different reproduction path or still reproduces after the canonical fix lands, please reply and Clownfish can reopen or split it back out.

  2. locked as resolved and limited conversation to collaborators on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions