Skip to content

[Feature]: Persistent outbox queue for outbound message reliability #14725

@lmkggko2421-dot

Description

@lmkggko2421-dot

Summary

When the gateway restarts (SIGUSR1, crash, or manual restart) during an active agent turn, any outbound messages that haven't been delivered yet are lost. This is because the current outbound delivery pipeline is entirely in-memory.

Current Behavior

  1. Agent generates a reply
  2. Reply is queued in memory for delivery to Slack/Telegram/etc.
  3. If gateway restarts between steps 2 and 3 → message is lost
  4. User sees the agent "go silent" with no indication of what happened

Proposed solution

Implement a persistent outbox queue:

  • Before sending: Write outbound messages to a local file/SQLite (e.g., ~/.openclaw/outbox/)
  • After confirmed delivery: Remove from outbox
  • On startup: Check outbox for unsent messages and retry delivery
  • Optional: Configurable retry count and backoff

Why This Matters

  • Slack Socket Mode has no built-in retry for bot-initiated messages (only for event acknowledgments)
  • Gateway restarts are common during config changes (SIGUSR1)
  • Users lose trust when messages disappear silently

Alternatives considered

I've implemented a manual patch that wraps the delivery pipeline with file-based persistence, but it breaks on every OpenClaw update and requires re-patching bundled files. A native solution would be far more reliable.

Additional context

This is especially important for Slack Socket Mode users, where outbound messages use the Web API (not the socket) and have no delivery guarantee across restarts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    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