openclaw - ✅(Solved) Fix [Bug]: [Telegram] sendChatAction and sendMessage fail with "Network request failed" — polling works, direct grammy/undici calls succeed [1 pull requests, 2 comments, 2 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#76172Fetched 2026-05-03 04:41:20
View on GitHub
Comments
2
Participants
2
Timeline
10
Reactions
2
Timeline (top)
commented ×2labeled ×2subscribed ×2closed ×1

The Telegram channel fails to send any outbound messages. Both sendChatAction and sendMessage consistently fail with:

Network request for 'sendChatAction' failed! Network request for 'sendChatAction' failed! The gateway receives inbound messages and Claude processes them (attempt-dispatch and stream-ready complete), but the response cannot be delivered back to Telegram.

This issue reproduces on both native Windows npm install and Docker container. It is not a network/connectivity issue — see diagnostics below.

Works:

Direct Node.js fetch() (native) → sendMessage → OK 200 ✓ Direct undici fetch → sendMessage → OK 200 ✓ Direct grammy bot.api.sendMessage() → received in Telegram ✓ TCP reachability test: api.telegram.org:443 → TcpTestSucceeded: True ✓ Inbound polling: messages received by OpenClaw ✓ Agent processing: Claude generates responses (stream-ready completes) ✓

Fails:

OpenClaw's internal sendChatAction → Network request failed ✗ OpenClaw's internal sendMessage (reply delivery) → Network request failed ✗ Polling long-poll (getUpdates) → fetch-timeout after ~30s ✗

Error Message

[telegram] [default] starting provider (@K_Rock_Bot) [fetch-timeout] fetch timeout reached; aborting operation [telegram] sendChatAction failed: Network request for 'sendChatAction' failed! [agent/embedded] attempt-dispatch totalMs=35670 ... auth:4258ms ... attempt-dispatch:5164ms [agent/embedded] stream-ready totalMs=42424 ... [fetch-timeout] fetch timeout reached; aborting operation [telegram] sendMessage failed: Network request for 'sendMessage' failed! [telegram] final reply failed: HttpError: Network request for 'sendMessage' failed! [telegram] Polling stall detected (no completed getUpdates for 201.36s)

Root Cause

The Telegram channel fails to send any outbound messages. Both sendChatAction and sendMessage consistently fail with:

Network request for 'sendChatAction' failed! Network request for 'sendChatAction' failed! The gateway receives inbound messages and Claude processes them (attempt-dispatch and stream-ready complete), but the response cannot be delivered back to Telegram.

This issue reproduces on both native Windows npm install and Docker container. It is not a network/connectivity issue — see diagnostics below.

Works:

Direct Node.js fetch() (native) → sendMessage → OK 200 ✓ Direct undici fetch → sendMessage → OK 200 ✓ Direct grammy bot.api.sendMessage() → received in Telegram ✓ TCP reachability test: api.telegram.org:443 → TcpTestSucceeded: True ✓ Inbound polling: messages received by OpenClaw ✓ Agent processing: Claude generates responses (stream-ready completes) ✓

Fails:

OpenClaw's internal sendChatAction → Network request failed ✗ OpenClaw's internal sendMessage (reply delivery) → Network request failed ✗ Polling long-poll (getUpdates) → fetch-timeout after ~30s ✗

Fix Action

Fix / Workaround

Network request for 'sendChatAction' failed! Network request for 'sendChatAction' failed! The gateway receives inbound messages and Claude processes them (attempt-dispatch and stream-ready complete), but the response cannot be delivered back to Telegram.

Run OpenClaw 2026.4.29 on Windows (npm) or Docker on Windows host Configure Telegram channel with valid bot token Start gateway — observe starting provider (@BotName) in logs Send a DM to the bot Observe: agent dispatches and processes, but no reply arrives in Telegram Logs show sendChatAction failed and sendMessage failed

[telegram] [default] starting provider (@K_Rock_Bot)
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendChatAction failed: Network request for 'sendChatAction' failed!
[agent/embedded] attempt-dispatch totalMs=35670 ... auth:4258ms ... attempt-dispatch:5164ms
[agent/embedded] stream-ready totalMs=42424 ...
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendMessage failed: Network request for 'sendMessage' failed!
[telegram] final reply failed: HttpError: Network request for 'sendMessage' failed!
[telegram] Polling stall detected (no completed getUpdates for 201.36s)

PR fix notes

PR #48537: Telegram: avoid aborting sends on polling restart

Description (problem / solution / changelog)

Summary

When Telegram polling stalls, OpenClaw restarts the polling session by aborting the shared Telegram fetch abort signal. That currently aborts in-flight sendMessage / sendChatAction requests too, which turns a polling recovery into visible reply failures.

This change scopes the shutdown abort behavior to getUpdates only, so polling restarts no longer cancel unrelated outbound Telegram API sends.

What changed

  • moved shutdown abort handling from the shared Telegram fetch wrapper to a bot.api.config.use(...) middleware that only applies to getUpdates
  • kept existing polling restart behavior for long-poll requests
  • added regression tests to verify:
    • getUpdates is still aborted on shutdown/restart
    • non-polling requests such as sendMessage are not aborted by the polling restart path

Why

In local reproduction, polling stalls were causing log patterns like:

Polling stall detected ... forcing restart.
telegram sendChatAction failed ... <- AbortError
telegram sendMessage failed ... <- AbortError

The stall itself is one bug; aborting unrelated sends during recovery is a separate, fixable regression that makes the user-facing impact much worse.

Validation

  • pnpm test -- extensions/telegram/src/bot.fetch-abort.test.ts extensions/telegram/src/monitor.test.ts

Related

  • Follow-up startup long-poll stall issue: #48536

Changed files

  • extensions/telegram/src/bot.fetch-abort.test.ts (modified, +57/-13)
  • extensions/telegram/src/bot.ts (modified, +49/-45)

Code Example

[telegram] [default] starting provider (@K_Rock_Bot)
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendChatAction failed: Network request for 'sendChatAction' failed!
[agent/embedded] attempt-dispatch totalMs=35670 ... auth:4258ms ... attempt-dispatch:5164ms
[agent/embedded] stream-ready totalMs=42424 ...
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendMessage failed: Network request for 'sendMessage' failed!
[telegram] final reply failed: HttpError: Network request for 'sendMessage' failed!
[telegram] Polling stall detected (no completed getUpdates for 201.36s)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

The Telegram channel fails to send any outbound messages. Both sendChatAction and sendMessage consistently fail with:

Network request for 'sendChatAction' failed! Network request for 'sendChatAction' failed! The gateway receives inbound messages and Claude processes them (attempt-dispatch and stream-ready complete), but the response cannot be delivered back to Telegram.

This issue reproduces on both native Windows npm install and Docker container. It is not a network/connectivity issue — see diagnostics below.

Works:

Direct Node.js fetch() (native) → sendMessage → OK 200 ✓ Direct undici fetch → sendMessage → OK 200 ✓ Direct grammy bot.api.sendMessage() → received in Telegram ✓ TCP reachability test: api.telegram.org:443 → TcpTestSucceeded: True ✓ Inbound polling: messages received by OpenClaw ✓ Agent processing: Claude generates responses (stream-ready completes) ✓

Fails:

OpenClaw's internal sendChatAction → Network request failed ✗ OpenClaw's internal sendMessage (reply delivery) → Network request failed ✗ Polling long-poll (getUpdates) → fetch-timeout after ~30s ✗

Steps to reproduce

Run OpenClaw 2026.4.29 on Windows (npm) or Docker on Windows host Configure Telegram channel with valid bot token Start gateway — observe starting provider (@BotName) in logs Send a DM to the bot Observe: agent dispatches and processes, but no reply arrives in Telegram Logs show sendChatAction failed and sendMessage failed

Expected behavior

When a user sends a DM to the bot, OpenClaw delivers the agent's response back to Telegram via sendMessage. The typing indicator (sendChatAction) shows while the agent is processing.

Actual behavior

Both sendChatAction and sendMessage fail with "Network request failed". The agent receives and processes the message (Claude generates a response) but the reply is never delivered. The Telegram polling (getUpdates) also stalls and times out after ~30 seconds, requiring a transport rebuild loop.

OpenClaw version

2026.4.29 (a448042)

Operating system

Windows 10.0.26200 (x64) / Docker Linux container

Install method

npm (Windows) + Docker (ghcr.io/openclaw/openclaw:latest)

Model

anthropic/claude-sonnet-4-5

Provider / routing chain

Telegram (long polling) → OpenClaw gateway → anthropic/claude-sonnet-4-5 → reply fails at sendMessage (Telegram outbound)

Additional provider/model setup details

Provider: Anthropic (API key auth) Model: anthropic/claude-sonnet-4-5 Auth method: ANTHROPIC_API_KEY environment variable Agent processes requests successfully — auth and model resolution complete without errors. Issue is isolated to Telegram outbound send path, not provider connectivity

Logs, screenshots, and evidence

[telegram] [default] starting provider (@K_Rock_Bot)
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendChatAction failed: Network request for 'sendChatAction' failed!
[agent/embedded] attempt-dispatch totalMs=35670 ... auth:4258ms ... attempt-dispatch:5164ms
[agent/embedded] stream-ready totalMs=42424 ...
[fetch-timeout] fetch timeout reached; aborting operation
[telegram] sendMessage failed: Network request for 'sendMessage' failed!
[telegram] final reply failed: HttpError: Network request for 'sendMessage' failed!
[telegram] Polling stall detected (no completed getUpdates for 201.36s)

Impact and severity

Impact: Complete loss of Telegram channel functionality — bot receives messages and Claude processes them but no responses are ever delivered. Channel is unusable. Severity: High — affects all outbound Telegram sends on Windows (both native npm and Docker). Workaround exists via browser dashboard only.

Additional information

Config

channels.telegram.network.autoSelectFamily: false OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY=1 OPENCLAW_TELEGRAM_DNS_RESULT_ORDER=ipv4first

(None of the above resolved the issue)

extent analysis

TL;DR

The Telegram channel's outbound message sending fails due to a network request issue, and a potential workaround could be to investigate and adjust the DNS resolution or network settings.

Guidance

  • Investigate the DNS resolution order and settings, as the provided configuration suggests attempts to adjust OPENCLAW_TELEGRAM_DNS_RESULT_ORDER and OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY did not resolve the issue.
  • Verify the network connectivity and firewall settings to ensure they are not blocking the outbound requests to Telegram.
  • Consider testing with a different DNS resolver or network configuration to isolate the issue.
  • Review the logs for any patterns or clues that might indicate the root cause of the "Network request failed" error.

Example

No code snippet is provided as the issue seems to be related to network or configuration settings rather than code.

Notes

The issue seems to be isolated to the Telegram outbound send path and does not affect inbound message reception or processing. The fact that direct Node.js fetch and grammy bot.api.sendMessage work suggests the issue might be specific to the OpenClaw internal implementation or configuration.

Recommendation

Apply workaround: Investigate and adjust DNS resolution or network settings, as the current configuration and settings do not seem to be working correctly, and a different approach might resolve the issue.

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

When a user sends a DM to the bot, OpenClaw delivers the agent's response back to Telegram via sendMessage. The typing indicator (sendChatAction) shows while the agent is processing.

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 - ✅(Solved) Fix [Bug]: [Telegram] sendChatAction and sendMessage fail with "Network request failed" — polling works, direct grammy/undici calls succeed [1 pull requests, 2 comments, 2 participants]