hermes - 💡(How to fix) Fix feat(gateway): launchd plist loses environment variables on every gateway start (macOS) [1 pull requests]

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…

Root Cause

On macOS, hermes gateway start regenerates the launchd plist from scratch on every invocation. Because launchd does not inherit the user's shell environment, any variables set in the terminal session — HTTP_PROXY, HTTPS_PROXY, custom PATH entries, etc. — are silently dropped and unavailable to the gateway process.

Fix Action

Fixed

Code Example

gateway:
  extra_env:
    HTTP_PROXY: "http://127.0.0.1:8888"
    HTTPS_PROXY: "http://127.0.0.1:8888"
    NO_PROXY: "localhost,127.0.0.1"
RAW_BUFFERClick to expand / collapse

Problem

On macOS, hermes gateway start regenerates the launchd plist from scratch on every invocation. Because launchd does not inherit the user's shell environment, any variables set in the terminal session — HTTP_PROXY, HTTPS_PROXY, custom PATH entries, etc. — are silently dropped and unavailable to the gateway process.

There is currently no way to persist custom environment variables across gateway restarts without manually editing the plist (which gets overwritten on the next start).

Steps to Reproduce

  1. Set HTTP_PROXY=http://127.0.0.1:8888 in your shell
  2. Run hermes gateway start
  3. Inspect ~/Library/LaunchAgents/ai.hermes.gateway.plistEnvironmentVariables section contains only PATH, VIRTUAL_ENV, HERMES_HOME — proxy is missing
  4. Gateway process cannot reach the network through the proxy

Expected Behaviour

A way to declare persistent environment variables in ~/.hermes/config.yaml that are always injected into the launchd plist regardless of how many times the gateway is restarted.

Proposed Solution

Add gateway.extra_env to config.yaml:

gateway:
  extra_env:
    HTTP_PROXY: "http://127.0.0.1:8888"
    HTTPS_PROXY: "http://127.0.0.1:8888"
    NO_PROXY: "localhost,127.0.0.1"

Implemented in #21145.

Environment

  • macOS (launchd only — Linux systemd is not affected)

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