openclaw - 💡(How to fix) Fix Internal HTTP client (memory-core embedding) ignores HTTP_PROXY / HTTPS_PROXY env vars [1 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#62930Fetched 2026-04-09 08:00:31
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

OpenClaw's internal HTTP client used by memory-core for embedding API calls does not respect HTTP_PROXY / HTTPS_PROXY environment variables or the env config in openclaw.json.

Error Message

"error": { Same error — the internal HTTP client does not read proxy env vars.

Root Cause

OpenClaw's internal HTTP client used by memory-core for embedding API calls does not respect HTTP_PROXY / HTTPS_PROXY environment variables or the env config in openclaw.json.

Fix Action

Workaround

Switched to memorySearch.provider: "local" (node-llama-cpp). Works but loses Gemini's superior embedding quality.

Code Example

Memory index failed (main): gemini embeddings failed: 400 {
  "error": {
    "code": 400,
    "message": "User location is not supported for the API use.",
    "status": "FAILED_PRECONDITION"
  }
}

---

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 openclaw memory index --force
RAW_BUFFERClick to expand / collapse

Bug / Feature Request

Summary

OpenClaw's internal HTTP client used by memory-core for embedding API calls does not respect HTTP_PROXY / HTTPS_PROXY environment variables or the env config in openclaw.json.

Environment

  • OS: macOS 15.3 (arm64)
  • OpenClaw: 2026.4.5
  • Node: v25.8.0
  • Location: Hong Kong (Gemini API restricted region)

Steps to Reproduce

  1. Configure plugins.entries.memory-core with dreaming.enabled: true
  2. Set memorySearch.provider: "gemini" (default auto-detection)
  3. Add proxy config in openclaw.json: "env": {"HTTP_PROXY": "http://127.0.0.1:7890", "HTTPS_PROXY": "http://127.0.0.1:7890"}
  4. Run openclaw memory index --force

Expected Behavior

The Gemini embedding API call should route through the configured proxy, allowing users in restricted regions (e.g. Hong Kong, China mainland) to use Gemini embeddings.

Actual Behavior

Memory index failed (main): gemini embeddings failed: 400 {
  "error": {
    "code": 400,
    "message": "User location is not supported for the API use.",
    "status": "FAILED_PRECONDITION"
  }
}

The request goes direct, ignoring proxy settings. Verified by testing the same API key with curl --proxy which works correctly.

Also tested setting env vars directly in the shell before running the CLI:

HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 openclaw memory index --force

Same error — the internal HTTP client does not read proxy env vars.

Workaround

Switched to memorySearch.provider: "local" (node-llama-cpp). Works but loses Gemini's superior embedding quality.

Suggested Fix

The internal HTTP/fetch client used for embedding (and potentially other provider API calls) should:

  1. Read HTTP_PROXY/HTTPS_PROXY from both shell env and openclaw.json config env block
  2. Apply proxy settings to outbound API requests
  3. This would benefit not just Gemini embedding but any provider API call in restricted network environments

Additional Context

  • The openclaw.json config already has an env block with proxy settings, but memory-core's embedding HTTP client doesn't use it
  • The 2026.4.5 changelog mentions "Providers/request overrides" with proxy controls, but these may only apply to the main provider transport, not the embedding subsystem
  • Users behind corporate firewalls or in API-restricted regions are affected

extent analysis

TL;DR

Modify the internal HTTP client in memory-core to respect HTTP_PROXY and HTTPS_PROXY environment variables and the env config in openclaw.json to route embedding API calls through a proxy.

Guidance

  • Verify that the openclaw.json config env block is correctly formatted and contains the proxy settings.
  • Check if the HTTP_PROXY and HTTPS_PROXY environment variables are set in the shell before running the openclaw command.
  • Consider modifying the memory-core code to read proxy settings from both the shell environment and the openclaw.json config env block.
  • Test the modified internal HTTP client with curl --proxy to ensure it correctly routes API calls through the proxy.

Example

// Example of how to read proxy settings from env and config
const proxy = process.env.HTTP_PROXY || process.env.https_proxy || config.env.HTTP_PROXY;
const httpsProxy = process.env.HTTPS_PROXY || process.env.https_proxy || config.env.HTTPS_PROXY;

Notes

The provided workaround of switching to memorySearch.provider: "local" may not be ideal due to the loss of Gemini's superior embedding quality. A more robust solution would be to modify the internal HTTP client to respect proxy settings.

Recommendation

Apply workaround by modifying the internal HTTP client to respect HTTP_PROXY and HTTPS_PROXY environment variables and the env config in openclaw.json, as this would benefit not just Gemini embedding but any provider API call in restricted network environments.

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