openclaw - 💡(How to fix) Fix [Bug] Telegram gateway drops in-flight messages on sendChatAction network failure during hot reload [2 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#71429Fetched 2026-04-26 05:12:47
View on GitHub
Comments
2
Participants
2
Timeline
2
Reactions
0
Timeline (top)
commented ×2

During gateway hot reload, sendChatAction calls fail with network errors and any in-flight outbound message that has not yet been delivered to Telegram is silently dropped. The agent appears to have responded (text exists in internal INFO stream and is visible in webchat UI), but the user on Telegram never receives the message.

Root Cause

During gateway hot reload, sendChatAction calls fail with network errors and any in-flight outbound message that has not yet been delivered to Telegram is silently dropped. The agent appears to have responded (text exists in internal INFO stream and is visible in webchat UI), but the user on Telegram never receives the message.

RAW_BUFFERClick to expand / collapse

Summary

During gateway hot reload, sendChatAction calls fail with network errors and any in-flight outbound message that has not yet been delivered to Telegram is silently dropped. The agent appears to have responded (text exists in internal INFO stream and is visible in webchat UI), but the user on Telegram never receives the message.

Environment

  • OpenClaw runtime: 2026.4.20
  • Channel: telegram (long-poll bot mode)
  • Trigger: gateway hot reload during a live agent turn
  • Affected agent: agent:kusanagi:telegram:direct:<redacted> (Anthropic Claude Opus 4.7)

Repro

  1. Start a long-poll telegram bot via OpenClaw gateway
  2. Captain sends a message that triggers a multi-tool agent turn (~10s+)
  3. Trigger gateway hot reload while the agent is mid-response
  4. Observe sendChatAction retry/failure log entries (≥10 in our case at 2026-04-24 21:01:25 KST, 12 consecutive failures)
  5. Outcome: the agent's final text appears in webchat UI (internal INFO stream) but never arrives at the Telegram user

Expected

In-flight outbound messages should either (a) be queued to a durable buffer and re-sent post-reload, or (b) abort the turn and surface a clear failure to both UI and the agent itself so it can retry.

Actual

Silent drop. Mismatch between internal stream (UI sees response) and external delivery (Telegram user does not). User experiences "ghost" turn — agent did the work but the answer never arrived. Captain has to manually copy from UI back to Telegram or restart the conversation.

Impact

  • User-facing reliability: silent message loss is the worst possible failure mode
  • Cross-channel inconsistency: webchat UI and Telegram diverge
  • Recovery cost: human (Captain) becomes the manual relay

Suggested fix direction

  • Persist outbound queue to disk (small append-only journal per channel) — survives reload
  • On reload, drain queue before resuming new turns
  • Treat sendChatAction retry exhaustion as a hard turn failure with explicit notification to both ends
  • Optional: expose a gateway.outbound.queue.depth metric so operators can detect backlog

Cross-references

  • NOW-003 (a) — auto-compaction issue (related context-loss family)
  • YET-004 — /halt gateway interception feature request (same gateway boundary)
  • YET-003 — plugin-level security enforcement (related gateway/plugin work)

Notes

This is reported as part of OpenClaw multi-agent operating model hardening (Captain JS — Kusanagi/Tachikoma/Togusa/Bato 4-agent setup). Happy to share full log excerpt and run-time config on request (will redact tokens).

extent analysis

TL;DR

Implementing a durable buffer for outbound messages, such as persisting the queue to disk, can prevent silent message loss during gateway hot reloads.

Guidance

  • Investigate the feasibility of implementing a small append-only journal per channel to store outbound messages, allowing them to survive reloads.
  • Consider treating sendChatAction retry exhaustion as a hard turn failure, providing explicit notification to both the agent and the user.
  • Review the suggested fix direction provided, which includes draining the queue before resuming new turns and exposing a gateway.outbound.queue.depth metric for operator detection of backlogs.
  • Evaluate the potential benefits of auto-compaction and plugin-level security enforcement in relation to this issue, as mentioned in the cross-references.

Example

No specific code snippet is provided due to the lack of explicit code references in the issue.

Notes

The provided guidance is based on the information given in the issue and may require further investigation and testing to ensure a complete solution. The suggested fix direction appears to address the root cause of the problem but may need to be adapted to the specific implementation details of the OpenClaw gateway and the telegram channel.

Recommendation

Apply the suggested workaround of persisting the outbound queue to disk to prevent silent message loss during gateway hot reloads, as it directly addresses the identified issue and provides a clear path forward for implementation.

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 [Bug] Telegram gateway drops in-flight messages on sendChatAction network failure during hot reload [2 comments, 2 participants]