HTTPS_PROXY, HTTP_PROXY, ALL_PROXY). However, Node 22’s built-in fetch does not honor these variables by default. This page documents the behavior and the workaround Comis ships.
The Node 22 fetch caveat
Node 22’s built-infetch() — the global function exposed without an import — is implemented on top of the undici HTTP client. Unlike axios, node-fetch, or older HTTP libraries, Node’s built-in fetch silently ignores the HTTPS_PROXY and HTTP_PROXY environment variables. Setting them has no effect on requests made via fetch().
The unsupported_region error from auth.openai.com is the canonical signal that an operator needs a US-region proxy, but the obvious fix (export HTTPS_PROXY=http://proxy.example.com:8080) does nothing for the OAuth refresh path because the daemon uses fetch() (per pi-ai’s implementation) for token rotation.
How Comis honors HTTPS_PROXY
WhenHTTPS_PROXY (or HTTP_PROXY, or ALL_PROXY) is set in the daemon’s environment, Comis configures undici’s global dispatcher to route outbound requests through that proxy at boot time. This is done once during daemon startup and applies to every subsequent fetch() call — including OAuth token refreshes, the gateway callback’s exchange step, and any fetch_url skill invocations.
~/.comis/.env
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
unsupported_region error from OAuth refresh | OpenAI sees your network’s egress IP; need to route via a US-region proxy | Set HTTPS_PROXY=http://us-proxy.example.com:8080, restart daemon |
| Proxy set in shell, daemon ignores it | Env var not visible to the daemon process (e.g., set in .bashrc after pm2 spawned the process) | Set the var in ~/.comis/.env (read by all Comis processes), or in the systemd unit Environment= directive, then restart |
Proxy works for curl but not Comis | The other tool was using node-fetch / axios (which honor HTTPS_PROXY via their own logic); Comis uses Node’s built-in fetch and configures the proxy at boot | Confirm the env var is in the daemon’s environment when it boots (check cat /proc/$(pgrep -f comis-daemon)/environ | tr '\0' '\n' | grep -i proxy) |
| Authenticated proxy 407 error | Username / password not URL-escaped | URL-encode special characters: @ -> %40, : -> %3A, etc. |
unsupported_region error code’s full classification and other OAuth error codes, see OAuth concepts -> Error classification.
Related
OAuth
Subscription-based authentication and the full OAuth error catalogue
Environment Variables
All env vars Comis reads, including proxy-related variables
Troubleshooting
Common issues across daemon, channels, and runtime
Daemon
Startup, shutdown, and the boot-time proxy wiring
