-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Summary
Upgrading from 2026.2.23 to 2026.2.24 causes all outbound HTTP requests (model API, Telegram API) to fail with Connection error when the host requires an HTTP proxy (e.g. behind GFW). The Telegram channel initialization in 2.24 calls setGlobalDispatcher(new Agent({...})) which replaces the process-wide undici dispatcher with a bare Agent that ignores HTTP_PROXY/HTTPS_PROXY env vars. Rolling back to 2026.2.23 resolves the issue.
Steps to reproduce
- Host behind GFW (or any network requiring proxy for outbound HTTPS)
- Configure HTTP_PROXY/HTTPS_PROXY pointing to local proxy (e.g. Clash on 127.0.0.1:7890)
- Run OpenClaw 2026.2.23 — everything works
- Upgrade to 2026.2.24:
npm install -g openclaw@2026.2.24 - Restart gateway — all outbound requests fail with "Connection error"
Expected behavior
Outbound fetch() calls should respect HTTP_PROXY/HTTPS_PROXY environment variables, as they did in 2026.2.23.
Actual behavior
All outbound requests bypass proxy and attempt direct connections, failing with:
05:15:07 [telegram] global undici dispatcher autoSelectFamily=true
05:16:25 [agent/embedded] embedded run agent end: isError=true error=Connection error.
Telegram Bot API also fails: Network request for 'deleteMyCommands' failed!
OpenClaw version
2026.2.24
Operating system
Ubuntu Linux 6.17.0-14-generic
Install method
npm install -g openclaw@2026.2.24
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
Root Cause
The fix for #25682 in 2026.2.24 introduced setGlobalDispatcher(new Agent({...})) in Telegram channel init (dist/plugin-sdk/send-Bnjm2l2x.js, ~L1151). This replaces the default proxy-aware dispatcher with a bare Agent that:
- Does NOT read
HTTP_PROXY/HTTPS_PROXYenv vars - Affects all
fetch()calls process-wide, not just Telegram's
Suggested Fix
Option A (minimal): Use EnvHttpProxyAgent instead of bare Agent:
import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
setGlobalDispatcher(new EnvHttpProxyAgent({ connect: {
autoSelectFamily: autoSelectDecision.value,
autoSelectFamilyAttemptTimeout: 300
} }));Option B (better): Scope the dispatcher to Telegram only — don't touch the global dispatcher at all.