Skip to content

web_fetch ignores HTTP_PROXY environment variables - dispatcherPolicy defaults to direct #61480

Description

@dt-todtom

Bug Description

In OpenClaw 2026.4.2, the web_fetch tool does not respect HTTP_PROXY/HTTPS_PROXY environment variables even when they are correctly configured in the systemd service.

Root Cause

In http-client-COwW1KRl.js line 111:

dispatcher = createPinnedDispatcher(
  await resolvePinnedHostnameWithPolicy(currentUrl.hostname, { policy: params.ssrfPolicy }),
  params.dispatcherPolicy,
  params.ssrfPolicy
);

In ssrf-BWlfjI7J.js, createPinnedDispatcher() checks policy.mode:

if (!policy || policy.mode === "direct") return new Agent({...});
if (policy.mode === "env-proxy") return new EnvHttpProxyAgent({...});

Because params.dispatcherPolicy is never set to {mode: "env-proxy"}, the dispatcher always falls back to a direct Agent.

Suggested Fix

Detect HTTP_PROXY/HTTPS_PROXY and pass {mode: "env-proxy"} as dispatcherPolicy.

Environment

  • OpenClaw: 2026.4.2
  • Node.js: v24.14.1
  • OS: Linux 6.8.0-107-generic (Ubuntu 24.04/x64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions