Bug Report
Version
- OpenClaw: 2026.4.5
- Node: v22 (inside OpenShell sandbox)
- undici: bundled with Node
Description
globalThis.fetch (powered by undici) does not route through HTTP_PROXY/HTTPS_PROXY by default. This means any code path that uses globalThis.fetch or undici's fetch() directly bypasses the proxy entirely.
In proxy-only environments (like OpenShell sandboxes where all traffic must go through an HTTP CONNECT proxy at 10.200.0.1:3128), this causes LLM provider requests to fail silently or with connection errors — the requests attempt direct connections that the network namespace blocks.
Affected Code Paths
Workaround
At Node.js startup (via NODE_OPTIONS=--require), manually set the global dispatcher:
const { EnvHttpProxyAgent, setGlobalDispatcher } = require('undici');
if (process.env.HTTPS_PROXY || process.env.HTTP_PROXY) {
setGlobalDispatcher(new EnvHttpProxyAgent());
}
This makes all globalThis.fetch calls honor proxy env vars. We've been running this in production across 4 OpenShell sandboxes since 2026.4.5.
Expected Behavior
When HTTP_PROXY/HTTPS_PROXY are set, OpenClaw should configure undici's global dispatcher to use EnvHttpProxyAgent so that all fetch-based requests route through the proxy — matching the behavior of Node's http/https modules.
Environment
- OpenShell sandbox with HTTP CONNECT proxy (no direct internet, no DNS)
HTTP_PROXY=http://10.200.0.1:3128 and HTTPS_PROXY=http://10.200.0.1:3128 exported
Related Issues
Bug Report
Version
Description
globalThis.fetch(powered by undici) does not route throughHTTP_PROXY/HTTPS_PROXYby default. This means any code path that usesglobalThis.fetchor undici'sfetch()directly bypasses the proxy entirely.In proxy-only environments (like OpenShell sandboxes where all traffic must go through an HTTP CONNECT proxy at
10.200.0.1:3128), this causes LLM provider requests to fail silently or with connection errors — the requests attempt direct connections that the network namespace blocks.Affected Code Paths
globalThis.fetchinternallyAgentdispatcher has no proxy awarenessWorkaround
At Node.js startup (via
NODE_OPTIONS=--require), manually set the global dispatcher:This makes all
globalThis.fetchcalls honor proxy env vars. We've been running this in production across 4 OpenShell sandboxes since 2026.4.5.Expected Behavior
When
HTTP_PROXY/HTTPS_PROXYare set, OpenClaw should configure undici's global dispatcher to useEnvHttpProxyAgentso that all fetch-based requests route through the proxy — matching the behavior of Node'shttp/httpsmodules.Environment
HTTP_PROXY=http://10.200.0.1:3128andHTTPS_PROXY=http://10.200.0.1:3128exportedRelated Issues
wslibrary also doesn't honorHTTPS_PROXYmemory_searchremote embeddings fail behind proxy