Skip to content

feat: Improve WSL2 network compatibility — VPN-dependent API connections and slow streaming response #1853

@34262315716

Description

@34262315716

Pre-submission checklist | 提交前检查

  • I have searched existing issues and this has not been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • I have read the project documentation and confirmed this issue does not already exist | 我已阅读项目文档并确认此问题尚未存在
  • This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Problem Statement | 问题陈述

When running MemOS as a plugin within OpenClaw deployed in WSL2 (Windows 11 + Ubuntu), two related issues are observed:

  1. VPN Required for API Model Connections: The MemOS plugin cannot reach any upstream LLM API endpoint (e.g., OpenAI, DeepSeek, Anthropic) without a VPN or proxy connection active on the Windows host. This suggests the plugin either does not respect WSL2's proxy environment variables (HTTP_PROXY/HTTPS_PROXY) or does not handle WSL2's network bridge correctly.

  2. Extremely Slow Streaming Response Under VPN: When the VPN is active and connections succeed, streaming log/token responses are noticeably laggy — there is a significant delay between each streamed chunk, making real-time interaction nearly unusable. This does not occur with the same model on the same network when used outside of WSL2 (e.g., native browser or a Windows-hosted client).

Combined, these symptoms suggest poor WSL2 network stack compatibility — likely related to how MemOS (or its plugin layer) handles:

  • System proxy / environment variable discovery in WSL2
  • WebSocket/SSE streaming over WSL2's virtualized network adapter
  • DNS resolution or HTTP keep-alive under proxied connections

Expected Behavior | 预期行为

  • MemOS should work out-of-the-box in WSL2 without requiring manual VPN configuration
  • API model connections should respect system proxy settings (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) or offer explicit proxy configuration
  • Streaming responses under a proxy/VPN should not have excessive latency compared to native environments

Additional Context | 其他信息

Environment:

  • Host OS: Windows 11
  • WSL2 Distro: Ubuntu (WSL2)
  • MemOS: Running as OpenClaw plugin (memos-local-plugin)
  • Network Requirement: VPN/proxy mandatory for model API access (region-dependent)
  • Symptom: Without VPN -> connection refused / timeout; With VPN -> streaming lag

The existing issues around network stability in proxied environments and WSL2 compatibility would also benefit from proper documentation of proxy configuration in the MemOS docs.

Willingness to Implement | 实现意愿

  • I am willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working | 功能异常pluginPlugin/adapter/bridge layer (apps/ directory) | 插件/适配层

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions