Software engineers working in regulated sectors—such as banking, fintech, healthcare, and enterprise software—frequently hit an invisible wall when adopting modern AI code assistants. After installing Supermaven in Neovim (supermaven-nvim) or VS Code, code completions either fail completely or intermittently vanish.
Inspecting the extension logs reveals the signature culprit:
INFO [sm_agent] Starting sm-agent
INFO [sm_agent::edge_connection] Starting new edge connection
ERROR [sm_agent::edge_connection] connection init timed out (5s)
INFO [sm_agent::edge_connection] websocket closed - shutting down Edge Connection
This guide details why Supermaven’s daemon (sm-agent) fails in restricted enterprise networks and provides concrete, battle-tested solutions to eliminate WebSocket timeouts, navigate corporate forward proxies, and properly establish custom SSL/TLS root certificate trust chains.
The Architecture: Why Supermaven Fails Behind Corporate Firewalls
Unlike lightweight plugins that poll REST APIs over standard HTTPS, Supermaven is engineered around extreme low-latency completion streaming:
- Separation of Editor and Agent: The editor plugin (
supermaven-nvimor the VS Code extension) acts purely as an interface. The heavy lifting—local context ingestion, buffer monitoring, and network streaming—is handled by a compiled background binary calledsm-agent. - Persistent WebSocket Long-Connections:
sm-agentestablishes a real-time, bidirectional WebSocket connection (wss://, targeting endpoints likestream.supermaven.comandsupermaven.comover port 443). - The Aggressive 5-Second Handshake Timeout:
sm-agenthardcodes an aggressive 5-second initialization window (connection init timed out (5s)). In consumer broadband environments, a TLS and WebSocket upgrade handshake takes 50–150 ms. In enterprise environments, that handshake must traverse multi-tiered proxy balancers, perform NTLM/Kerberos authentication, and undergo man-in-the-middle (MITM) deep packet inspection. This easily exceeds 5 seconds, causingsm-agentto abort the connection. - Environment Isolation in GUI Launchers: When editors are launched via OS application menus or desktop shortcuts, child processes spawned by the editor frequently fail to inherit terminal-defined proxy environment variables (
HTTP_PROXY,HTTPS_PROXY). - MITM SSL Decryption & Custom CA Roots: Enterprise security appliances (e.g., Zscaler, Netskope, Palo Alto Networks, Blue Coat) intercept outbound TLS traffic and re-sign sessions using an internal enterprise certificate authority. If
sm-agentcannot validate this corporate root certificate, the TLS handshake stalls or rejects immediately.
365Finds Institutional Judgments & Recommendations
At 365Finds, we evaluate developer infrastructure from both practical developer productivity and strict enterprise security governance:
- Prefer Layer-3 TUN / Transparent Routing over Ad-Hoc Proxy Hacks: Relying on ad-hoc environment variables (
HTTP_PROXY,ALL_PROXY) across diverse compiled binaries is inherently brittle. 365Finds recommends OS-level TUN routing (or enterprise split-tunneling) as the most reliable, zero-touch method for native daemons likesm-agent. - Do Not Disable SSL Verification as a Permanent Workaround: Setting flags like
NODE_TLS_REJECT_UNAUTHORIZED=0or disabling SSL checking in editor configs violates enterprise compliance and exposes developer credentials. The professional resolution is injecting the enterprise Root CA into system certificate stores. - Always Launch Editors from an Initialized Terminal Session: Launching Neovim or VS Code via
nvim .orcode .from a configured shell profile guarantees complete environment variable propagation to all spawned background daemons. - Enterprise SecOps Resolution: The definitive enterprise fix is obtaining an infosec egress exemption that permits outbound WebSocket (
Upgrade: websocket) traffic to*.supermaven.comover port 443, bypassing deep TLS re-encryption.
Step 1: Standardizing Proxy Environment Variables
The first step is ensuring all standard proxy variables are declared consistently across lowercase and uppercase formats in your shell profile (~/.bashrc, ~/.zshrc, or /etc/environment).
Add the following configuration:
# Corporate Proxy Configuration
export HTTP_PROXY="http://proxy.corp.internal:8080"
export HTTPS_PROXY="http://proxy.corp.internal:8080"
export http_proxy="http://proxy.corp.internal:8080"
export https_proxy="http://proxy.corp.internal:8080"
# SOCKS / Generic Tunneling (if supported)
export ALL_PROXY="socks5://proxy.corp.internal:1080"
export all_proxy="socks5://proxy.corp.internal:1080"
# Bypass local and internal domain resolution
export NO_PROXY="localhost,127.0.0.1,.corp.internal,10.0.0.0/8,192.168.0.0/16"
export no_proxy="localhost,127.0.0.1,.corp.internal,10.0.0.0/8,192.168.0.0/16"
Apply changes:
source ~/.zshrc # or source ~/.bashrc
[!IMPORTANT] If your proxy requires basic authentication, avoid writing plaintext credentials into dotfiles. Use URL encoding if special characters exist in passwords (
http://user:p%40ssword@proxy:8080), or use a local authentication sidecar as shown in Step 3.
Step 2: Injecting Corporate Root CA Certificates
If your organization inspects encrypted traffic, sm-agent will fail the TLS handshake unless the enterprise CA root certificate is present in the runtime's trust store.
1. Export the Enterprise Root Certificate
Obtain your corporate root certificate from your IT helpdesk or export it from your system keychain in PEM format (e.g., corp-root-ca.crt or corp-ca-bundle.pem).
2. Update the Operating System Certificate Store
On Ubuntu / Debian:
sudo cp corp-root-ca.crt /usr/local/share/ca-certificates/corp-root-ca.crt
sudo update-ca-certificates
On RHEL / CentOS / Rocky Linux / Fedora:
sudo cp corp-root-ca.crt /etc/pki/ca-trust/source/anchors/
sudo update-ca-trust
On macOS:
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain corp-root-ca.crt
3. Direct Runtime TLS Libraries to the CA Bundle
Compiled Rust binaries and Node-based extension hosts reference specific environment variables for certificate discovery. Add these to your shell profile:
# OpenSSL / Rust TLS standard pointers
export SSL_CERT_FILE="/etc/ssl/certs/ca-certificates.crt"
export SSL_CERT_DIR="/etc/ssl/certs"
# Node.js / VS Code extension runtime
export NODE_EXTRA_CA_CERTS="/path/to/corp-ca-bundle.pem"
Step 3: Bridging NTLM / Kerberos with a Local Proxy Sidecar
In banking and defense environments, corporate proxies often demand NTLM or Active Directory Kerberos handshakes that standalone CLI binaries cannot negotiate.
The standard engineering solution is deploying a lightweight local forwarding sidecar—such as Cntlm or Px—on 127.0.0.1. The local daemon handles upstream enterprise authentication, providing a clean local forward proxy without upstream authentication headaches.
Example Cntlm Configuration (/etc/cntlm.conf):
Username developer_id
Domain CORP_DOMAIN
Proxy proxy.corp.internal:8080
Listen 127.0.0.1:3128
NoProxy localhost, 127.0.0.*, *.corp.internal
Generate your NTLM hash:
cntlm -H
Add the generated PassNTLMv2 hash to /etc/cntlm.conf and start the service:
sudo systemctl enable --now cntlm
Then point your environment variables to the local sidecar:
export HTTP_PROXY="http://127.0.0.1:3128"
export HTTPS_PROXY="http://127.0.0.1:3128"
export http_proxy="http://127.0.0.1:3128"
export https_proxy="http://127.0.0.1:3128"
Step 4: Forcing Traffic Through Layer-3 TUN or ProxyChains
When corporate proxies refuse or mishandle HTTP Upgrade: websocket headers over standard forward proxy ports, application-level variables are insufficient.
Approach A: Network-Level TUN Mode (Recommended by 365Finds)
Using modern client-side routing tools (such as Clash, sing-box, or enterprise-approved VPN clients configured with a virtual TUN interface) transparently captures all layer-3 IP packets emitted by sm-agent.
- Packets destined for
*.supermaven.comare encapsulated at the OS network interface level. sm-agentoperates as though it has a direct internet route, bypassing proxy-awareness bugs and environment variable inheritance failures entirely.
Approach B: Wrapping via ProxyChains (proxychains-ng)
For Neovim users who cannot modify network adapters, proxychains-ng hooks dynamic socket calls (connect, poll) using LD_PRELOAD:
- Configure
/etc/proxychains.conf:
strict_chain
proxy_dns
[ProxyList]
http 127.0.0.1 3128
- Launch Neovim wrapped with proxychains:
proxychains4 -q nvim
This forces all outbound TCP connections initiated by Neovim and its spawned child processes (sm-agent) through the local proxy adapter.
Step 5: Enterprise Firewall Whitelisting Specifications
If you have direct access to your network engineering or infosec team, requesting an explicit egress whitelist is the cleanest permanent fix. Provide the following specification:
| Field | Configuration Specification |
|---|---|
| Target Domains | *.supermaven.com, supermaven.com, stream.supermaven.com |
| Destination Port | TCP 443 (Outbound) |
| Protocol / Method | HTTPS and Secure WebSockets (wss://) via HTTP GET with Upgrade: websocket |
| Expected Server Response | HTTP 101 Switching Protocols |
| Inspection Policy | Bypass Deep Packet Inspection (DPI) / SSL Re-encryption or apply unified Enterprise Root CA |
| Connection Timeout | Maintain TCP Keepalive; idle timeout threshold >= 300 seconds |
Step 6: Verification and Diagnostics
Once configured, verify connectivity before opening your editor.
1. Locate the sm-agent Binary
Supermaven downloads sm-agent to your user directory:
- Linux/macOS:
~/.supermaven/binary/v[version]/[platform]-[arch]/sm-agent - Windows:
%LOCALAPPDATA%\supermaven\sm-agent.exe
Verify executable permissions:
chmod +x ~/.supermaven/binary/*/*/sm-agent
2. Test WebSocket Egress via CLI
Test whether your proxy permits WebSocket upgrades to Supermaven’s edge cluster using curl:
curl -i -N \
-H "Connection: Upgrade" \
-H "Upgrade: websocket" \
-H "Host: supermaven.com" \
-H "Origin: https://supermaven.com" \
-x "http://127.0.0.1:3128" \
https://supermaven.com/
A successful handshake will return an HTTP/1.1 101 Switching Protocols or an authorized upgrade response rather than a 403 Forbidden, 502 Bad Gateway, or 504 Gateway Timeout.
3. Verify in Neovim (supermaven-nvim)
In your Neovim configuration, enable debug logging:
require("supermaven-nvim").setup({
log_level = "debug",
})
Launch Neovim from the terminal:
nvim .
Inspect plugin output using :messages or :SupermavenStatus. A properly connected agent will output:
INFO [sm_agent] Starting sm-agent
INFO [sm_agent::edge_connection] Starting new edge connection
INFO [sm_agent::edge_connection] UserStatus: Free Tier (or Pro Tier)
The absence of connection init timed out (5s) confirms that the WebSocket handshake completed within the timeout threshold and real-time completions are active.
Strategy Comparison
| Strategy | Setup Overhead | Enterprise Security Compliance | 5s Timeout Resilience | Recommended Scenario |
|---|---|---|---|---|
Shell Environment Variables (HTTP_PROXY) | Minimal | High (uses standard routes) | Moderate (vulnerable to handshake latency) | Standard corporate proxies with standard SSL trust |
Local Sidecar (Cntlm / Px) | Moderate | High (eliminates cleartext credentials) | High | Environments requiring corporate NTLM / Kerberos auth |
| Layer-3 TUN Routing | Moderate | Moderate (requires local network tool permissions) | Very High | When proxies reject or strip WebSocket upgrade headers |
| SecOps Firewall Whitelisting | High (ticket/approval required) | Highest (fully sanctioned by IT) | Maximum | Long-term institutional and team-wide deployments |