openclaw - 💡(How to fix) Fix Inbound message queue during agent reload (prevent message loss)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

Current workaround

  • messages.queue.mode: collect with cap: 50 helps serialize responses but does NOT prevent message loss during reload.
  • Custom watchdog script polls sessions.json.telegram-messages.json and re-enqueues orphans.

Code Example

{
  "channels": {
    "telegram": {
      "inbox": {
        "queueOnReset": true,
        "maxQueueDepth": 50,
        "queueTTLSeconds": 60
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

When openclaw.json is modified (e.g. adding a provider), the gateway performs a session reset/reload for all topic agents. During this reload window, inbound Telegram messages are silently dropped — they arrive at the gateway but no agent is available to process them since the session is being reset.

Evidence from production

  • Session reset file: sessions/*.jsonl.reset.2026-05-17T07-35-46.420Z
  • New session file starts at 07:35:52, while user messages at 07:29, 07:31, 07:32 never reached any agent.
  • Liveness warnings during the window show the agent queue was empty/resetting.

Proposed solution

Maintain a transient inbound message queue per agent/channel. When the target agent session is in reset/reload state, buffer messages instead of discarding them. Drain the queue FIFO once reload completes.

Key behaviors

  1. Enqueue on unavailable agent: queue message with timestamp when session is resetting
  2. Drain on ready: process queued messages after session load completes
  3. TTL/expiry: drop messages older than N seconds (configurable)
  4. Limit: configurable queue depth per session

Configuration suggestion

{
  "channels": {
    "telegram": {
      "inbox": {
        "queueOnReset": true,
        "maxQueueDepth": 50,
        "queueTTLSeconds": 60
      }
    }
  }
}

Current workaround

  • messages.queue.mode: collect with cap: 50 helps serialize responses but does NOT prevent message loss during reload.
  • Custom watchdog script polls sessions.json.telegram-messages.json and re-enqueues orphans.

But this should be handled natively in the gateway.

Impact

  • Medium: silent message loss under specific conditions (config change + concurrent messaging)
  • Reproducible: edit openclaw.json while talking to a topic agent in a Telegram group

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Inbound message queue during agent reload (prevent message loss)