Skip to content

[NemoClaw][All platforms] Discord channel fails with 400 — Node.js EnvHttpProxyAgent uses forward proxy instead of CONNECT tunnel #1570

@zNeill

Description

@zNeill

Description

Summary

Discord WebSocket gateway connection fails with 400 Bad Request inside the NemoClaw sandbox. The OpenShell proxy correctly supports WebSocket upgrades via CONNECT tunnels (#652), but Node.js's built-in EnvHttpProxyAgent (activated by the HTTPS_PROXY environment variable in the sandbox) sends HTTPS requests using forward proxy mode (GET https://gateway.discord.gg/...) instead of issuing a CONNECT tunnel request. The OpenShell proxy correctly rejects this with 400: Use CONNECT for HTTPS URLs.

Root cause

  1. Sandbox sets HTTPS_PROXY=http://10.200.0.1:3128 for all processes
  2. Node.js https.get() picks up HTTPS_PROXY and uses EnvHttpProxyAgent
  3. EnvHttpProxyAgent sends a forward proxy request (not CONNECT)
  4. OpenShell proxy rejects HTTPS forward proxy requests with 400
  5. Discord gateway never establishes a WebSocket connection

The proxy's WebSocket upgrade support is working correctly — the issue is on the client side.

Evidence

[discord] failed to deploy native commands: Error (status=403, body={"detail":"PUT ... not permitted by policy","error":"policy_denied"}) [discord] gateway error: Error: getaddrinfo EAI_AGAIN gateway.discord.gg [discord] gateway error: AggregateError [discord] gateway: WebSocket connection closed with code 1006

Manual test from inside sandbox:$ node -e "require('https').get('https://gateway.discord.gg/?v=10&encoding=json', ...)"
STATUS: 400

(Node.js used forward proxy path due to HTTPS_PROXY)

Suggested fix

One or more of:

  1. Pre-install ws + https-proxy-agent in the sandbox base image so OpenClaw's Discord client can use a CONNECT-aware WebSocket library
  2. Document that WebSocket-based channels require a CONNECT-capable proxy agent and how to configure it in the sandbox
  3. OpenClaw upstream: ensure Discord client uses CONNECT tunnel when HTTPS_PROXY is set (e.g. configure discord.js / grammy with an explicit proxy agent)

Environment

  • NemoClaw v0.0.7
  • OpenShell 0.0.23
  • OpenClaw 2026.3.11
  • Node.js 22.22.1

Bug Details

Field Value
Priority Unprioritized
Action Dev - Open - To fix
Disposition Open issue
Module Machine Learning - NemoClaw
Keyword NemoClaw, NEMOCLAW_GH_SYNC_APPROVAL

[NVB# 6056219]

[NVB#6056219]

Metadata

Metadata

Assignees

No one assigned

    Labels

    NV QABugs found by the NVIDIA QA TeamOpenShellSupport for OpenShell, a safe, private runtime for autonomous AI agentsbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions