openclaw - 💡(How to fix) Fix [Bug]: Duplicate Inbound Message Delivery [1 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#59951Fetched 2026-04-08 02:38:24
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
2
Participants
Timeline (top)
labeled ×2

A single Telegram message is injected into the agent session 2–3 times as separate inbound events ~60s apart, causing the agent to send duplicate replies and re-run expensive operations.

Root Cause

A single Telegram message is injected into the agent session 2–3 times as separate inbound events ~60s apart, causing the agent to send duplicate replies and re-run expensive operations.

Code Example

sessions_history evidence showing the 3 duplicate entries:
seq 1067 — timestamp: 1775161793245 (20:29:53 UTC)
seq 1068 — timestamp: 1775161853551 (20:30:53 UTC)
seq 1069 — timestamp: 1775161914209 (20:31:54 UTC)
All three: identical message text, same sender 428450616, same Telegram message_id 3585, but different OpenClaw event timestamps ~60s apart. Also mention: no duplicate delivery entries visible at INFO level in /tmp/openclaw/openclaw-2026-04-02.log.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

A single Telegram message is injected into the agent session 2–3 times as separate inbound events ~60s apart, causing the agent to send duplicate replies and re-run expensive operations.

Steps to reproduce

  1. Run OpenClaw 2026.3.31 (213a704) with a Telegram group chat (forum/topics) channel.
  2. Have a user send a single message in the Telegram group topic.
  3. Observe the agent session history — the same message appears as 2–3 separate inbound events ~60s apart.
  4. The agent responds to each duplicate event separately.

Expected behavior

Each Telegram message should be delivered exactly once to the agent session, deduplicated by Telegram message_id.

Actual behavior

The same Telegram message (same sender, same message_id) is delivered as 2–3 separate inbound events with different internal timestamps spaced ~60s apart. This was observed consistently on 2026-04-02 across multiple messages and sessions.

OpenClaw version

2026.3.31 (213a704)

Operating system

Ubuntu 24.04 (Hetzner VPS, Helsinki — ubuntu-4gb-hel1-1)

Install method

npm

Model

claude-opus-4.6

Provider / routing chain

telegram gateway -> agent:main session

Additional provider/model setup details

{ "agents": { "defaults": { "timeoutSeconds": 1800, "heartbeat": { "every": "6h", "isolatedSession": true } } }, "telegram": { "execApprovals": { "enabled": true, "approvers": ["428450616"] }, "streaming": "partial", "heartbeat": { "showOk": true } } }

Logs, screenshots, and evidence

sessions_history evidence showing the 3 duplicate entries:
seq 1067 — timestamp: 1775161793245 (20:29:53 UTC)
seq 1068 — timestamp: 1775161853551 (20:30:53 UTC)
seq 1069 — timestamp: 1775161914209 (20:31:54 UTC)
All three: identical message text, same sender 428450616, same Telegram message_id 3585, but different OpenClaw event timestamps ~60s apart. Also mention: no duplicate delivery entries visible at INFO level in /tmp/openclaw/openclaw-2026-04-02.log.

Impact and severity

Affected: Any agent using a Telegram group/topics channel on 2026.3.31 Severity: High — blocks correct agent behavior Frequency: Always/consistent — observed repeatedly throughout 2026-04-02 Consequence: Agent sends duplicate replies to users; re-runs expensive operations (e.g., a 17-minute content engine cycle was re-triggered unnecessarily by a duplicate event)

Additional information

The ~60s retry spacing suggests a webhook retry mechanism: either Telegram retrying unacknowledged webhooks, OpenClaw gateway inbound retry logic, or session message queue replay. The gateway does not appear to deduplicate by message_id before injecting into the session. No regression baseline is noted (no prior version confirmed as working).

extent analysis

TL;DR

Implementing deduplication by Telegram message_id in the OpenClaw gateway or agent session may resolve the issue of duplicate inbound events.

Guidance

  • Investigate the OpenClaw gateway's inbound retry logic to determine if it is causing the duplicate events.
  • Check if Telegram's webhook retry mechanism is enabled and if it is set to retry unacknowledged webhooks at 60-second intervals.
  • Consider adding a deduplication mechanism in the agent session to filter out duplicate events based on the Telegram message_id.
  • Review the OpenClaw configuration to ensure that the "streaming" mode is set to "partial" and that the "execApprovals" are enabled, as these settings may be related to the issue.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The root cause of the issue is unclear, but it is likely related to the retry mechanism of either the OpenClaw gateway or Telegram's webhook. The ~60s retry spacing suggests a periodic retry mechanism.

Recommendation

Apply a workaround by implementing deduplication by Telegram message_id in the OpenClaw gateway or agent session, as this is the most likely solution to resolve the issue of duplicate inbound events.

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…

FAQ

Expected behavior

Each Telegram message should be delivered exactly once to the agent session, deduplicated by Telegram message_id.

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]: Duplicate Inbound Message Delivery [1 participants]