Summary
On macOS, when the system routes internet traffic through a local proxy (e.g., Clash Verge / mihomo on port 7897), the generated LaunchAgent plist does not include HTTP_PROXY / HTTPS_PROXY environment variables. This causes the gateway process to fail silently when connecting to external APIs (e.g., Telegram setMyCommands, polling).
Environment
- macOS 15.4 (Darwin 25.2.0, arm64, Mac mini M4)
- OpenClaw 2026.2.25
- Node.js v24.13.0
- Proxy: Clash Verge (mihomo), mixed port 7897
- Install method: npm global
Steps to Reproduce
- Run macOS with a local proxy (e.g., Clash Verge on port 7897)
- Install OpenClaw and set up Telegram channel
- Run
openclaw gateway install (generates the LaunchAgent plist)
- Start the gateway via launchd
- Gateway fails to connect to Telegram API —
Network request for 'setMyCommands' failed!
Root Cause
LaunchAgent processes do not inherit the user's shell environment variables. The proxy is configured at the system/app level (Clash Verge sets system proxy), but launchd-managed processes bypass this entirely.
The generated plist at ~/Library/LaunchAgents/ai.openclaw.gateway.plist has an EnvironmentVariables dict but does not include HTTP_PROXY or HTTPS_PROXY.
DNS resolving to 198.18.0.x (Clash virtual IPs) confirms the system-level proxy is active, but the gateway process cannot use it without explicit env vars.
Workaround
Manually add to the plist EnvironmentVariables:
<key>HTTP_PROXY</key>
<string>http://127.0.0.1:7897</string>
<key>HTTPS_PROXY</key>
<string>http://127.0.0.1:7897</string>
Problem: Every openclaw gateway install --force or version upgrade overwrites the plist, requiring manual re-patching each time.
Suggested Fix
- During
openclaw gateway install, detect if HTTP_PROXY / HTTPS_PROXY / ALL_PROXY are set in the current shell and propagate them into the generated plist.
- Or provide a config option (e.g.,
gateway.proxy) that gets written into the plist automatically.
- At minimum, document this gotcha for users behind proxies (especially common in China where proxies are near-universal).
Summary
On macOS, when the system routes internet traffic through a local proxy (e.g., Clash Verge / mihomo on port 7897), the generated LaunchAgent plist does not include
HTTP_PROXY/HTTPS_PROXYenvironment variables. This causes the gateway process to fail silently when connecting to external APIs (e.g., TelegramsetMyCommands, polling).Environment
Steps to Reproduce
openclaw gateway install(generates the LaunchAgent plist)Network request for 'setMyCommands' failed!Root Cause
LaunchAgent processes do not inherit the user's shell environment variables. The proxy is configured at the system/app level (Clash Verge sets system proxy), but
launchd-managed processes bypass this entirely.The generated plist at
~/Library/LaunchAgents/ai.openclaw.gateway.plisthas anEnvironmentVariablesdict but does not includeHTTP_PROXYorHTTPS_PROXY.DNS resolving to
198.18.0.x(Clash virtual IPs) confirms the system-level proxy is active, but the gateway process cannot use it without explicit env vars.Workaround
Manually add to the plist
EnvironmentVariables:Problem: Every
openclaw gateway install --forceor version upgrade overwrites the plist, requiring manual re-patching each time.Suggested Fix
openclaw gateway install, detect ifHTTP_PROXY/HTTPS_PROXY/ALL_PROXYare set in the current shell and propagate them into the generated plist.gateway.proxy) that gets written into the plist automatically.