openclaw - 💡(How to fix) Fix Bug: LAN provider requests may still use proxy when NO_PROXY is CIDR-only [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#52058Fetched 2026-04-08 01:16:03
View on GitHub
Comments
2
Participants
2
Timeline
3
Reactions
0
Participants
Timeline (top)
commented ×2subscribed ×1

When OpenClaw Gateway runs with proxy env vars enabled and NODE_USE_ENV_PROXY=1, requests to a LAN-hosted model provider can time out if NO_PROXY only uses CIDR entries such as 192.168.x.0/24.

Error Message

At minimum, OpenClaw should warn about this case.

Root Cause

The problem appears to be proxy bypass matching.

With:

HTTP_PROXY=...
HTTPS_PROXY=...
ALL_PROXY=...
NO_PROXY=localhost,127.0.0.1,::1,192.168.x.0/24
NODE_USE_ENV_PROXY=1

Gateway requests to the LAN target still timed out.

After changing NO_PROXY to include the explicit LAN host IP, the problem disappeared immediately.

Code Example

HTTP_PROXY=...
HTTPS_PROXY=...
ALL_PROXY=...
NO_PROXY=localhost,127.0.0.1,::1,192.168.x.0/24
NODE_USE_ENV_PROXY=1
RAW_BUFFERClick to expand / collapse

Summary

When OpenClaw Gateway runs with proxy env vars enabled and NODE_USE_ENV_PROXY=1, requests to a LAN-hosted model provider can time out if NO_PROXY only uses CIDR entries such as 192.168.x.0/24.

What happened

A model provider was configured to use a private LAN endpoint.

Gateway started normally, config loaded correctly, but model calls kept timing out.

What I verified

The LAN provider itself was healthy:

  • direct GET /v1/models worked
  • direct POST /v1/chat/completions worked
  • direct POST /v1/responses worked

So this was not a bad provider config, bad API key, or dead service.

Root cause

The problem appears to be proxy bypass matching.

With:

HTTP_PROXY=...
HTTPS_PROXY=...
ALL_PROXY=...
NO_PROXY=localhost,127.0.0.1,::1,192.168.x.0/24
NODE_USE_ENV_PROXY=1

Gateway requests to the LAN target still timed out.

After changing NO_PROXY to include the explicit LAN host IP, the problem disappeared immediately.

Why this matters

This is easy to misdiagnose as a model/provider timeout, even though the real issue is proxy bypass behavior for internal LAN targets.

Suggested fix

At minimum, OpenClaw should warn about this case.

Possible improvements:

  1. document that CIDR-style NO_PROXY entries may be unreliable here
  2. add a doctor/startup warning when NODE_USE_ENV_PROXY=1 is used with CIDR-only NO_PROXY
  3. consider bypassing proxy for internal/private provider targets more explicitly

Notes

This looks related in spirit to the earlier loopback/browser proxy issue, but affects private LAN targets rather than only 127.0.0.1.

extent analysis

Fix Plan

To resolve the issue with proxy bypass matching, follow these steps:

  • Update the NO_PROXY environment variable to include the explicit LAN host IP.
  • Consider adding a warning in OpenClaw when NODE_USE_ENV_PROXY=1 is used with CIDR-only NO_PROXY entries.

Example code to add a warning in OpenClaw:

if (process.env.NODE_USE_ENV_PROXY === '1' && process.env.NO_PROXY.includes('/')) {
  console.warn('Using CIDR-only NO_PROXY entries may cause issues with internal LAN targets.');
}

Alternatively, you can modify the proxy bypass logic to explicitly bypass the proxy for internal/private provider targets:

const proxy = require('proxy-agent');
const internalTargets = ['192.168.x.0/24']; // add internal target IPs or CIDRs

// ...

if (internalTargets.some(target => ipaddr.parse(target).contains(ipaddr.parse(url.hostname)))) {
  // bypass proxy for internal targets
  options.agent = null;
}

Verification

To verify that the fix worked, test the Gateway requests to the LAN target with the updated NO_PROXY environment variable or modified proxy bypass logic. The requests should no longer time out.

Extra Tips

  • Document the potential issues with using CIDR-style NO_PROXY entries for internal LAN targets.
  • Consider adding a doctor/startup warning when NODE_USE_ENV_PROXY=1 is used with CIDR-only NO_PROXY entries to prevent similar issues in the future.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING