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
- Sandbox sets
HTTPS_PROXY=http://10.200.0.1:3128 for all processes - Node.js
https.get() picks up HTTPS_PROXY and uses EnvHttpProxyAgent EnvHttpProxyAgent sends a forward proxy request (not CONNECT)- OpenShell proxy rejects HTTPS forward proxy requests with 400
- 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:
- Pre-install
ws + https-proxy-agent in the sandbox base image so OpenClaw's Discord client can use a CONNECT-aware WebSocket library - Document that WebSocket-based channels require a CONNECT-capable proxy agent and how to configure it in the sandbox
- 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]
Description
Summary
Discord WebSocket gateway connection fails with
400 Bad Requestinside the NemoClaw sandbox. The OpenShell proxy correctly supports WebSocket upgrades via CONNECT tunnels (#652), but Node.js's built-inEnvHttpProxyAgent(activated by theHTTPS_PROXYenvironment 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 with400: Use CONNECT for HTTPS URLs.Root cause
HTTPS_PROXY=http://10.200.0.1:3128for all processeshttps.get()picks upHTTPS_PROXYand usesEnvHttpProxyAgentEnvHttpProxyAgentsends a forward proxy request (not CONNECT)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 1006Manual 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:
ws+https-proxy-agentin the sandbox base image so OpenClaw's Discord client can use a CONNECT-aware WebSocket libraryHTTPS_PROXYis set (e.g. configurediscord.js/grammywith an explicit proxy agent)Environment
Bug Details
[NVB# 6056219]
[NVB#6056219]