-
-
Notifications
You must be signed in to change notification settings - Fork 69.2k
2026.3.2: Health-monitor stale-socket storms cause Telegram message duplication and device re-pair loops #38464
Description
Version
- OpenClaw:
2026.3.2(commit85377a2)
Issue Description
After upgrading to 2026.3.2, the health-monitor subsystem aggressively triggers stale-socket restarts for all Telegram providers, causing:
- Connection restart storms across all configured Telegram bots
- Device re-pairing events repeatedly
- Duplicate outbound message sends during reconnection windows
This pollutes user chat with noise and causes message duplication.
Observed Symptoms
1. Stale-socket restart storms
From /tmp/openclaw/openclaw-2026-03-07.log:
[telegram:cyba] health-monitor: restarting (reason: stale-socket)
[telegram:default] health-monitor: restarting (reason: stale-socket)
[telegram:descard] health-monitor: restarting (reason: stale-socket)
[telegram:mira] health-monitor: restarting (reason: stale-socket)
All four Telegram providers restarted at the same time: 2026-03-07T01:39:50Z
2. Duplicate message sends
Outbound logs show duplicate sends during reconnection:
telegram sendMessage ok chat=redacted message=1834 (01:32:56 UTC)
telegram sendMessage ok chat=redacted message=1837 (01:34:33 UTC)
telegram sendMessage ok chat=redacted message=1840 (01:38:21 UTC)
telegram sendMessage ok chat=redacted message=1841 (01:38:21 UTC)
Note: Messages 1840 and 1841 sent at exact same millisecond (2026-03-07T01:38:21.883Z) — same target, same timestamp.
3. Device re-pairing loops
device-pair: /pair invoked channel=telegram sender=redacted action=new
device-pair: telegram split send ok target=redacted account=default thread=none
device-pair: /pair invoked channel=telegram sender=redacted action=new
device-pair: telegram split send ok target=redacted account=default thread=none
Re-pair events triggered repeatedly during the restart storm window.
4. MEMORY.md truncation warnings
workspace bootstrap file MEMORY.md is 21850 chars (limit 20000); truncating in injected context
This is unrelated but adds noise on every user turn.
Gateway Status
- Running normally
- No configuration errors
- Bind mode:
loopback - Port:
18789 - Health probe: OK
Root Cause Analysis
The health-monitor stale-socket detector appears overly aggressive for Telegram connections after 2026.3.2 upgrade. It incorrectly flags healthy Telegram sockets as stale, triggering provider restarts. These restarts then:
- Re-trigger device pairing (causing
/pair invokedstorms) - Send duplicate messages during reconnection
This is internal gateway behavior — not from agent-level code. The duplication is happening in the Telegram send path after restart, not in message routing.
Workarounds Attempted
- Checked gateway health: Running normally
- Verified config: No health-monitor tunables exposed
- Checked for CLI flags: None to disable health-monitor or adjust stale-socket thresholds
- Tested alternative bind mode: Not yet tried
Expected Behavior
- Health-monitor should only restart truly stale sockets
- No duplicate message sends on reconnection
- No device re-pairing storms unless actual pairing occurs
- Stable, quiet restart behavior (not 4 providers restarting simultaneously)
Additional Context
- The user’s agent (
agent:main:telegram:direct:redacted) did not touch any gateway or Telegram configuration today. - Only work done was on
project_shodan_freedom(PR Bird tool repository appears to be private #24 merge + steps 17-20). - This issue emerged after
2026.3.2upgrade.
Suggested Fix
- Add health-monitor sensitivity configuration for stale-socket detection
- Disable or dampen Telegram health-monitor restarts specifically
- Improve message deduplication after provider restart
- Add exponential backoff to re-pair events to prevent storms