-
-
Notifications
You must be signed in to change notification settings - Fork 80.3k
Telegram subsystem: getUpdates polling silently non-functional despite reachable API #71066
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
No fields configured for issues without a type.
Telegram subsystem: getUpdates polling silently non-functional despite reachable API
Summary
The Telegram channel's long-polling never consumes updates from Telegram's Bot API, even though:
getMereturns the bot profile)api.telegram.orgis fully reachable from the host via plaincurl(HTTP 200 in ~500ms)undicifetch configuration, run as a standalone script from the same Node installation, succeeds instantlyThe subsystem logs
fetch fallback: enabling sticky IPv4-only dispatcher (codes=ETIMEDOUT,EHOSTUNREACH)every ~7 seconds but never recovers. Messages sent to the bot from clients remain pending on Telegram's servers indefinitely.Environment
00bd2cf)ws://127.0.0.1:18789)env | grep proxyis empty, and the LaunchAgent inherits noHTTP_PROXY/HTTPS_PROXY)Reproduction
openclaw channels add --channel telegram --token <valid-bot-token>/tmp/openclaw/openclaw-*.logExpected
getUpdates)Actual
{"subsystem":"telegram/network"} fetch fallback: enabling sticky IPv4-only dispatcher (codes=ETIMEDOUT,EHOSTUNREACH)curl https://api.telegram.org/bot<token>/getUpdatesfrom the same host shows pending updates accumulating — the gateway never consumes themEvidence that the network is fine
Evidence that undici (the transport the subsystem uses) is fine
Running a standalone script against the same
undicipackage installed under/opt/homebrew/lib/node_modules/openclaw/node_modules/undici/with Node v22.22.2:Output:
So Node,
undici, and every dispatcher variant thetelegram/networksubsystem attempts are all functional from the exact same environment. The failure is specific to the long-running gateway process.Things I've ruled out
getMecurlsucceeds consistentlyOPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY=1andOPENCLAW_TELEGRAM_DNS_RESULT_ORDER=ipv4firstin the LaunchAgent env stops the error log spam but does not start polling working; updates continue to pile uplaunchctl bootout/bootstrap,openclaw gateway restart, fullopenclaw doctor --fix— none recover pollingHTTP_PROXY/HTTPS_PROXYenv — not set in gateway plist nor in shelllibsimdutf.33.dylibwas missing;brew upgrade mervefixed the CLI path, no effect on the Telegram subsystem)Hypotheses (not yet ruled out)
telegram/networksubsystem's dispatcher gets into a bad state on first failure and never fully recovers — possibly a connection-pool-holding-stale-sockets issue specific to the subsystem's keep-alive settings (keepAliveTimeout: 30s,keepAliveMaxTimeout: 600s) combined with long-poll semantics.Suggested debug next steps
log.debuglogging when the IPv4-only dispatcher is actually constructed vs. reused — the current WARN log fires on every entry to the fallback path, which hides whether the dispatcher is being rebuilt or reused.cause.codeand socket state, not just the normalized error codes.openclaw channels debug telegramthat runs a single getMe call from within the gateway process and reports full error chain.Impact
On first install of the gateway, with a valid bot token and an otherwise-healthy network, Telegram messaging is completely non-functional — no user-facing error other than "messages don't show up."
Workaround
Polling via direct
curltoapi.telegram.org/bot<token>/getUpdatesworks; the issue is localized to the in-process dispatcher.