Skip to content

[Bug]: 2026.2.24 regression — setGlobalDispatcher breaks HTTP proxy for all outbound requests #26207

@qsysbio-cjw

Description

@qsysbio-cjw

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

  1. Host behind GFW (or any network requiring proxy for outbound HTTPS)
  2. Configure HTTP_PROXY/HTTPS_PROXY pointing to local proxy (e.g. Clash on 127.0.0.1:7890)
  3. Run OpenClaw 2026.2.23 — everything works
  4. Upgrade to 2026.2.24: npm install -g openclaw@2026.2.24
  5. 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_PROXY env 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdedupe:parentPrimary canonical item in dedupe cluster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions