openclaw - 💡(How to fix) Fix [Bug] Duplicate message ingestion - inbound messages appear 2x in session context (Telegram) [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#61758Fetched 2026-04-08 02:54:53
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Every inbound message from Telegram appears exactly twice in the session context, with the same message_id. This is 100% reproducible on every message sent.

Root Cause

Root cause likely: Duplicate event handlers registered within gateway process, or session context builder fetching messages twice from storage.

Code Example

[JingTying (@jingtying) id: 368505604] 现在做最后的测试
[message_id: 19165]

[JingTying (@jingtying) id: 368505604] 现在做最后的测试
[message_id: 19165]

---

{
  "channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "pairing",
      "streaming": "off",
      "accounts": {
        "default": {
          "dmPolicy": "allowlist",
          "allowFrom": ["368505604"],
          "streaming": "off"
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: 2026.4.5
  • OS: macOS (Darwin 25.4.0, arm64)
  • Node: v25.6.1
  • Install method: npm/pnpm (global)
  • Gateway mode: local LaunchAgent
  • Channels affected: Telegram (DM)

Description

Every inbound message from Telegram appears exactly twice in the session context, with the same message_id. This is 100% reproducible on every message sent.

Reproduction Steps

  1. Configure OpenClaw with Telegram channel (dmPolicy: allowlist, single bot token)
  2. Send any message from an authorized Telegram user
  3. Result: Message appears twice in agent context with identical message_id

Expected vs Actual Behavior

Expected: Each message appears once in the session context Actual: Each message appears twice with the same message_id

Example

[JingTying (@jingtying) id: 368505604] 现在做最后的测试
[message_id: 19165]

[JingTying (@jingtying) id: 368505604] 现在做最后的测试
[message_id: 19165]

What We Tried

  • ✅ Removed all plugins (memOS disabled) — no effect
  • ✅ Set streaming to "off" — no effect
  • ✅ Gateway restart — no effect
  • ✅ openclaw doctor — no errors detected
  • ✅ Fresh install would not help (see Issue #10377 — same bug on fresh install)
  • ❌ This bug is internal to OpenClaw, not a config or plugin issue

Configuration

{
  "channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "pairing",
      "streaming": "off",
      "accounts": {
        "default": {
          "dmPolicy": "allowlist",
          "allowFrom": ["368505604"],
          "streaming": "off"
        }
      }
    }
  }
}

Diagnosis

This matches Issue #10377 exactly — "Duplicate message ingestion - all inbound messages appear 2x in session context". That issue remains open and unfixed.

Root cause likely: Duplicate event handlers registered within gateway process, or session context builder fetching messages twice from storage.

Impact

  • Agent receives duplicate messages in every turn
  • Token usage doubled
  • Context pollution
  • Confusing user experience

References

extent analysis

TL;DR

The most likely fix for the duplicate message ingestion issue is to wait for a patch or fix for Issue #10377, as the root cause is likely internal to OpenClaw.

Guidance

  • Review the OpenClaw configuration to ensure that there are no unintended settings that could be contributing to the duplicate message ingestion.
  • Check the OpenClaw issue tracker for any updates or patches related to Issue #10377.
  • Consider implementing a temporary workaround, such as filtering out duplicate messages at the application level, to mitigate the impact of the issue.
  • Verify that the issue is not related to the Telegram channel configuration or the Node environment.

Example

No code snippet is provided as the issue is likely related to the internal workings of OpenClaw and not a simple code fix.

Notes

The issue is likely a duplicate of Issue #10377, which remains open and unfixed. The root cause is suspected to be related to duplicate event handlers or session context builder issues within OpenClaw.

Recommendation

Apply workaround: Implement a temporary filter to remove duplicate messages at the application level, as a fix for Issue #10377 is not yet available. This will help mitigate the impact of the issue until a patch is released.

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