-
-
Notifications
You must be signed in to change notification settings - Fork 52.7k
Description
Bug
The gateway injects the same Telegram DM into a session JSONL file twice, approximately 20 seconds apart. The duplicate has the identical Telegram message_id. This causes the LLM to process and respond to the same user message twice, resulting in duplicate outbound Telegram messages.
Reproduction
- User sends a single Telegram DM to the bot
- Gateway injects the message into the session at T+0
- Gateway injects the same message (same
message_id) again at ~T+20s - LLM responds to both injections, sending two identical replies
Evidence
From a session JSONL file, Telegram message_id: 4017 appears twice:
Timestamp: 2026-02-24T17:43:13.016Z message_id: "4017"
Timestamp: 2026-02-24T17:43:35.457Z message_id: "4017"
Content is identical. The 22-second gap suggests a retry/redelivery rather than a race condition.
This affects every DM in the session - 18 out of 179 log entries were sequential duplicates with identical content.
Expected Behavior
The gateway should deduplicate incoming Telegram messages by message_id before injecting them into the session. If a message with the same message_id already exists in the current session context, skip the duplicate.
Workaround
Added deduplication in a downstream log processor (extracts message_id and skips dupes), but this only fixes log output. The LLM still sees and responds to both copies.
Environment
- OpenClaw version: 2026.2.23
- Channel: Telegram (private DM)
- Platform: macOS (Darwin 25.3.0)