Repository navigation
Description
Summary
In OpenClaw 2026.6.1, Telegram direct-message delivery can become unreliable after Telegram API network timeouts. A direct-message lane may remain guarded after a failed/aborted send path, causing later DM messages to be delayed or not reflected in the target agent session until recovery.
Environment
- OpenClaw version: 2026.6.1
- Channel: Telegram
- Telegram mode: polling
- Affected route: direct DM to an agent session
- Gateway bind: lan
Observed behavior
During a Telegram network failure window, the user sent multiple direct messages. Some inbound Telegram updates were visible in gateway logs, but the corresponding agent session did not process/respond to the messages promptly. The agent appeared unresponsive until the lane recovered and later messages created/updated a fresh session.
Relevant sanitized log patterns:
telegram sendMessage failed: Network request for 'sendMessage' failed!
telegram sendChatAction failed: Network request for 'sendChatAction' failed!
fetch fallback: DNS-resolved IP unreachable; trying alternative Telegram API IP (... request-timeout ...)
[telegram][diag] timed out spooled update <update_id> did not stop within 5s after reply abort; keeping lane telegram:<user_id> guarded.
Delivery entry <id> delivery state is send_attempt_started; refusing blind replay without adapter reconciliation
Telegram reconnect drain: retry failed ... delivery state is send_attempt_started; refusing blind replay without adapter reconciliation
There were also diagnostic stale/stalled session messages around the same time, but the user-visible failure was that direct messages appeared to be ignored or delayed.
Expected behavior
Telegram inbound updates should be durable and should not be blocked by outbound delivery failures such as sendChatAction or sendMessage timeouts.
A Telegram network timeout should at worst delay outbound delivery. It should not silently prevent later direct messages from reaching the agent session.
Why this matters
From the user's perspective, the assistant appears to stop replying even though messages were sent. This is particularly confusing because later messages may start working again, making the issue look intermittent.
Suggested fixes
- Make
sendChatActionbest-effort only. Failure should not affect inbound update processing or lane health. - Persist inbound Telegram updates before outbound delivery/transcription/agent side effects.
- Add a bounded TTL/auto-release for guarded Telegram lanes.
- Reconcile
send_attempt_starteddelivery state after reconnect instead of refusing blind replay indefinitely. - Emit a visible diagnostic/system event when a DM lane is guarded due to Telegram delivery failure.
Reproduction idea
- Run OpenClaw with Telegram polling enabled.
- Open a Telegram DM to an agent.
- Send multiple quick DM messages.
- While a reply/sendChatAction is in progress, induce Telegram API timeouts, for example by blocking or delaying
api.telegram.orgtraffic. - Observe whether the DM lane enters guarded state and whether subsequent inbound messages are delayed/missing from the agent session.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 8, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.The permanent guarded Telegram ingress-lane failure is fixed on current main and documented as shipped in the 2026.7.1 release line; the remaining refusal to blindly replay an ambiguous outbound send is intentional duplicate-send protection, not a reason to keep inbound DM processing blocked.
Possible regression — probable (reproduction; failure trace). No predecessor PR is attributed.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the shipped durable ingress-drain lifecycle: adopt before reply delivery, release deferred lane occupancy, and dead-letter a bounded pre-adoption wedge without risky blind outbound replay.
Do we have a high-confidence way to reproduce the issue?
No current-main failure is established: the exact wedged-handler scenario is encoded in a current regression test that verifies the next same-lane update drains without restart.
Is this the best way to solve the issue?
Yes. The shipped repair fixes the lifecycle owner—durable ingress adoption and lane ownership—rather than treating one Telegram outbound error as a special case.
Security review:
Security review: No patch is under review.
AGENTS.md: found and applied where relevant.
What I checked:
src/channels/message/ingress-drain.ts:437, 5e477aff2adc)extensions/telegram/src/telegram-ingress-drain.ts:428, 5e477aff2adc)extensions/telegram/src/polling-session.test.ts:4100, 5e477aff2adc)src/channels/message/ingress-drain.ts:476, 77c84de5109a)appcast.xml:65, 5e477aff2adc)src/infra/outbound/delivery-queue-recovery.ts:761, 5e477aff2adc)Likely related people:
src/channels/message/ingress-drain.ts,extensions/telegram/src/telegram-ingress-drain.ts)extensions/telegram/src/polling-session.ts,extensions/telegram/src/polling-session.test.ts)Codex review notes: model internal, reasoning high; reviewed against 5e477aff2adc; fix evidence: release 2026.7.1, commit 77c84de5109a.
anguslogan01 commentedon Jun 12, 2026
Live repro — same guarded-lane failure mode, reached via a non-network inbound trigger
Hit this on OpenClaw 2026.5.28 (e932160), Telegram polling, direct DM lane. Exact signature line from this issue is present:
Key difference from the original report
This issue is framed around outbound failures (
sendMessage/sendChatActionnetwork timeouts). In my repro there was no outbound network failure. The trigger was an inbound reply handler that ran for 1500s and hit a hard handler-timeout, then failed to abort cleanly:Failed spool entry:
{"version":1,"updateId":<update_id>,"failure":{"reason":"handler-timeout", "message":"...timed out... after 1500.31s; marking the update failed, aborting active reply work, and restarting isolated ingress..."}}So the same guarded-lane / message-loss end state is reachable without any Telegram API timeout — a single stuck reply handler (e.g. a hung model stream during reply generation) is enough. A fix scoped only to the outbound path (suggested fix #1, "make
sendChatActionbest-effort") would not cover this path.Observed behavior
Nreply hangs 25 min → handler-timeout → lane guarded.N-1; updatesN+1 … N+4accumulate in the spool, never processed.disconnected, in:16h agowith the handler-timeout error sticky on the channel.The restart loop does not recover it (additional finding)
The Telegram health-monitor detected
disconnectedand auto-restarted the provider every ~10–15 min for ~16 hours / ~30 attempts:None cleared the guard. The orphaned reply promise from the timed-out handler is still pending in the Node process, so only a full gateway process restart releases the lane and drains the spool. Provider-level restart is insufficient.
Suggested scope additions
channels status --deep; gateway/healthstayslive, so external watchdogs report green while DMs are silently dropped.Repro (no network manipulation needed)
(All IDs/message contents redacted.)
6 remaining items
obviyus commentedon Aug 13, 2026
Thanks for the detailed report. This is fixed on current
main: a timed-out update is now dead-lettered, and the next DM in the same lane drains without a restart. Verified with the focused Telegram polling-session regression test.