mem0 TypeScript 与模型提供者通信时会忽略 env 所指定的代理设置 (http_proxy、HTTPS_PROXY)
作者: Ark-kun创建于 2026年9月17日更新于 2026年9月17日
标签bugsdk-typescript
- mem0-focused reproduction: the mem0ai package ignores HTTPS_PROXY and connects to the OpenAI API directly.
- We stand up a local proxy and point HTTPS_PROXY/HTTP_PROXY at it, then initialize mem0's OSS "Memory" with the OpenAI provider (dummy token).
- Because "vectorStore.config.dimension" is left unset, mem0's "_autoInitialize()" auto-detects the embedding dimension by calling "embedder.embed("dimension probe")" — i.e. it hits the OpenAI embeddings API during initialization (the very first "add()"/"_ensureInitialized()"), using the OpenAI Node SDK (node-fetch). This is where the proxy-ignoring failure surfaces in the wild (stack trace through "Memory._autoInitialize()").
- If mem0 honored the proxy, our proxy would receive a CONNECT for api.OpenAI.com. It does NOT: mem0 attempts a DIRECT TLS connection to api.OpenAI.com, so in a proxy-only egress sandbox the call fails with a connect/DNS error (or a 401 if direct egress happens to exist) — never touching the proxy.
- Run: node repro-mem0.mjs
内容来源: mem0ai/mem0