openclaw - 💡(How to fix) Fix Gateway proxy environment variables lost after launchctl restart [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60611Fetched 2026-04-08 02:49:10
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Code Example

<key>EnvironmentVariables</key>
<dict>
    <key>http_proxy</key>
    <string>http://127.0.0.1:7892</string>
    ...
</dict>
RAW_BUFFERClick to expand / collapse

Problem

When setting proxy environment variables (http_proxy, https_proxy, HTTP_PROXY, HTTPS_PROXY) in the Gateway launchd plist file, they are lost after every launchctl restart.

Steps to Reproduce

  1. Set proxy in ~/Library/LaunchAgents/ai.openclaw.gateway.plist:
<key>EnvironmentVariables</key>
<dict>
    <key>http_proxy</key>
    <string>http://127.0.0.1:7892</string>
    ...
</dict>
  1. Verify proxy is set: grep proxy ~/Library/LaunchAgents/ai.openclaw.gateway.plist → shows correctly
  2. Restart gateway: launchctl unload/load ~/Library/LaunchAgents/ai.openclaw.gateway.plist
  3. Check plist: grep proxy ~/Library/LaunchAgents/ai.openclaw.gateway.plist → proxy entries are gone

Expected Behavior

Proxy environment variables should persist after restart.

Environment

  • macOS
  • OpenClaw v2026.4.2
  • Using NVM node (v24.14.1)
  • Gateway installed via launchd

Additional Context

  • The Gateway plist file seems to be regenerated on each launchctl restart
  • Tried adding proxy via openclaw config set but no such config path exists for proxy
  • Doctor warns about NVM vs Homebrew node but that seems unrelated

Is this expected behavior? Is there a correct way to persist proxy settings across restarts?

extent analysis

TL;DR

The proxy environment variables are lost after each launchctl restart because the Gateway plist file is regenerated, so a different approach to setting persistent proxy settings is needed.

Guidance

  • The issue is likely due to the regeneration of the Gateway plist file on each restart, which overwrites the manually set proxy environment variables.
  • To verify the regeneration of the plist file, check the file's modification time before and after the launchctl restart command using stat ~/Library/LaunchAgents/ai.openclaw.gateway.plist.
  • Consider using a different method to set the proxy environment variables, such as setting them globally for the user or using a configuration file that is not regenerated on restart.
  • Check the OpenClaw documentation for any official ways to set persistent proxy settings, as the openclaw config set method does not seem to support proxy settings.

Example

No code example is provided as the issue is related to configuration and not code.

Notes

The solution may depend on the specific version of OpenClaw and the macOS environment. The regeneration of the Gateway plist file on each restart is the likely cause of the issue, but the exact solution may vary.

Recommendation

Apply a workaround by setting the proxy environment variables globally for the user or using a different configuration method that is not affected by the regeneration of the Gateway plist file. This is recommended because there is no clear official way to set persistent proxy settings using the openclaw config set method.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Gateway proxy environment variables lost after launchctl restart [1 participants]