Problem
The web_fetch tool does not use HTTP proxy even when https_proxy/HTTPS_PROXY environment variables are set in the gateway process. This causes web_fetch to fail with TypeError: fetch failed when the target site requires proxy access (e.g., behind GFW or corporate firewall).
The gateway process has proxy env vars configured:
HTTPS_PROXY=http://127.0.0.1:1083
HTTP_PROXY=http://127.0.0.1:1083
But web_fetch calls fetchWithWebToolsNetworkGuard() without useEnvProxy: true, so it always uses withStrictGuardedFetchMode (direct connection).
Meanwhile, the infrastructure already exists — fetchWithWebToolsNetworkGuard accepts useEnvProxy param, and withTrustedEnvProxyGuardedFetchMode correctly creates an env-proxy-aware dispatcher. It is just not exposed as a user configuration.
Proposed Solution
Add a config option in openclaw.json:
{
"tools": {
"webFetch": {
"useEnvProxy": true
}
}
}
When enabled, web_fetch tool calls should pass useEnvProxy: true to fetchWithWebToolsNetworkGuard().
Context
- This affects cron/isolated sessions and main sessions equally
exec tool with curl works fine as a workaround since curl respects env proxy vars
- The
withTrustedWebToolsEndpoint helper already uses useEnvProxy: true for trusted endpoints, showing this pattern is already established in the codebase
- Affected code:
pi-embedded → createWebFetchTool → runWebFetch → fetchWithWebToolsNetworkGuard
Environment
- OpenClaw 2026.4.9-beta.1
- Node.js v24.14.1
- Ubuntu 24.04
Problem
The
web_fetchtool does not use HTTP proxy even whenhttps_proxy/HTTPS_PROXYenvironment variables are set in the gateway process. This causesweb_fetchto fail withTypeError: fetch failedwhen the target site requires proxy access (e.g., behind GFW or corporate firewall).The gateway process has proxy env vars configured:
But
web_fetchcallsfetchWithWebToolsNetworkGuard()withoutuseEnvProxy: true, so it always useswithStrictGuardedFetchMode(direct connection).Meanwhile, the infrastructure already exists —
fetchWithWebToolsNetworkGuardacceptsuseEnvProxyparam, andwithTrustedEnvProxyGuardedFetchModecorrectly creates an env-proxy-aware dispatcher. It is just not exposed as a user configuration.Proposed Solution
Add a config option in
openclaw.json:{ "tools": { "webFetch": { "useEnvProxy": true } } }When enabled,
web_fetchtool calls should passuseEnvProxy: truetofetchWithWebToolsNetworkGuard().Context
exectool withcurlworks fine as a workaround since curl respects env proxy varswithTrustedWebToolsEndpointhelper already usesuseEnvProxy: truefor trusted endpoints, showing this pattern is already established in the codebasepi-embedded→createWebFetchTool→runWebFetch→fetchWithWebToolsNetworkGuardEnvironment