hermes - ✅(Solved) Fix Bug: `hermes webhook list` ignores `WEBHOOK_*` env-based runtime config and reports webhook disabled [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…

hermes webhook list can report:

Webhook platform is not enabled.

while the Hermes gateway is actually serving the webhook adapter successfully from env-based runtime config.

In my repro, the webhook server is live and /health returns:

{"status": "ok", "platform": "webhook"}

but hermes webhook list still says webhook is disabled unless platforms.webhook is also written into ~/.hermes/config.yaml.

Error Message

def _get_webhook_config() -> dict: try: from hermes_cli.config import load_config cfg = load_config() return cfg.get("platforms", {}).get("webhook", {}) except Exception: return {}

Root Cause

There are currently two different config-loading paths:

  • gateway/config.py:load_gateway_config()

    • merges config.yaml
    • applies WEBHOOK_ENABLED, WEBHOOK_PORT, WEBHOOK_SECRET env overrides
    • gateway runtime works correctly from env-based config
  • hermes_cli/webhook.py:_get_webhook_config()

    • calls hermes_cli.config.load_config()
    • reads config.yaml only
    • does not apply WEBHOOK_* env overrides

So the runtime and the CLI disagree about whether webhook is enabled.

Fix Action

Fixed

PR fix notes

PR #13266: fix(webhook): honor WEBHOOK_* env overrides in hermes_cli/webhook.py (#13240)

Description (problem / solution / changelog)

Fixes #13240.

Summary

hermes webhook list (and the rest of the hermes webhook CLI) read config from config.yaml only, while the gateway runtime also applied WEBHOOK_ENABLED / WEBHOOK_PORT / WEBHOOK_SECRET overrides via gateway/config.py:_apply_env_overrides. On env-driven deployments (Docker, Kubernetes secrets, .env files) this caused the CLI to report Webhook platform is not enabled even while the live gateway was serving webhooks successfully — /health returning {"status": "ok", "platform": "webhook"}.

Fix

hermes_cli/webhook.py:_get_webhook_config() now merges the same WEBHOOK_* env overrides on top of the YAML config. The inline block mirrors gateway/config.py:1072-1085 byte-for-byte, including the asymmetric "env can enable but not disable" behavior, so the two sources of truth cannot drift.

Considered swapping to load_gateway_config() directly but rejected: it mutates os.environ for ~20 other platforms and imports hermes_cli.auth, which is more surface area than a read-only webhook list should touch.

Test plan

  • New TestGetWebhookConfigEnvOverrides class in tests/hermes_cli/test_webhook_cli.py (8 cases):
    • YAML-only (enabled + disabled)
    • Env-only enables with port + secret
    • Env enables over YAML-disabled
    • Env secret overrides YAML secret; unset port leaves YAML port intact
    • Invalid port string is ignored
    • WEBHOOK_ENABLED=false does not flip YAML-enabled (asymmetry parity with gateway)
    • load_config() exception still honors env
  • uv run pytest tests/hermes_cli/test_webhook_cli.py — 26/26 pass (18 existing + 8 new)
  • Manual repro path exercised via unit test (env-only path matches reporter's config)

Changed files

  • hermes_cli/webhook.py (modified, +26/-3)
  • tests/hermes_cli/test_webhook_cli.py (modified, +85/-0)

Code Example

Webhook platform is not enabled.

---

{"status": "ok", "platform": "webhook"}

---

def _get_webhook_config() -> dict:
    try:
        from hermes_cli.config import load_config
        cfg = load_config()
        return cfg.get("platforms", {}).get("webhook", {})
    except Exception:
        return {}
RAW_BUFFERClick to expand / collapse

Summary

hermes webhook list can report:

Webhook platform is not enabled.

while the Hermes gateway is actually serving the webhook adapter successfully from env-based runtime config.

In my repro, the webhook server is live and /health returns:

{"status": "ok", "platform": "webhook"}

but hermes webhook list still says webhook is disabled unless platforms.webhook is also written into ~/.hermes/config.yaml.

Root Cause

There are currently two different config-loading paths:

  • gateway/config.py:load_gateway_config()

    • merges config.yaml
    • applies WEBHOOK_ENABLED, WEBHOOK_PORT, WEBHOOK_SECRET env overrides
    • gateway runtime works correctly from env-based config
  • hermes_cli/webhook.py:_get_webhook_config()

    • calls hermes_cli.config.load_config()
    • reads config.yaml only
    • does not apply WEBHOOK_* env overrides

So the runtime and the CLI disagree about whether webhook is enabled.

Relevant Code

hermes_cli/webhook.py

def _get_webhook_config() -> dict:
    try:
        from hermes_cli.config import load_config
        cfg = load_config()
        return cfg.get("platforms", {}).get("webhook", {})
    except Exception:
        return {}

gateway/config.py

  • load_gateway_config() explicitly documents env vars as highest priority
  • _apply_env_overrides() sets Platform.WEBHOOK.enabled = True from WEBHOOK_ENABLED

Repro

  1. Start Hermes gateway with env-based webhook config only, for example:
    • WEBHOOK_ENABLED=true
    • WEBHOOK_PORT=8644
    • WEBHOOK_SECRET=...
  2. Do not write platforms.webhook into ~/.hermes/config.yaml.
  3. Start the gateway.
  4. Confirm the runtime is healthy:
    • curl http://127.0.0.1:8644/health
    • returns {"status": "ok", "platform": "webhook"}
  5. Run:
    • hermes webhook list

Actual Result

hermes webhook list says webhook is not enabled.

Expected Result

hermes webhook list should use the same effective config source as the running gateway and recognize env-based webhook enablement.

Suggested Fix

One of these should happen upstream:

  1. Make hermes_cli/webhook.py use gateway.config.load_gateway_config() for webhook state.
  2. Or teach the webhook CLI path to apply WEBHOOK_* env overrides before checking platforms.webhook.

The key point is that the CLI and gateway should share one source of truth for effective webhook config.

Environment

  • Hermes image: nousresearch/hermes-agent:v2026.4.8
  • Reproduced in a containerized / managed deployment where the gateway runtime is configured via env vars and Kubernetes secrets.

extent analysis

TL;DR

The hermes webhook list command does not recognize the webhook as enabled when configured via environment variables, requiring a fix to align the config-loading paths between the gateway and CLI.

Guidance

  • The discrepancy arises from two separate config-loading paths: one for the gateway (gateway/config.py:load_gateway_config()) and one for the CLI (hermes_cli/webhook.py:_get_webhook_config()), which do not apply environment variable overrides consistently.
  • To verify the issue, follow the repro steps provided, ensuring that WEBHOOK_ENABLED and other relevant environment variables are set without writing platforms.webhook into ~/.hermes/config.yaml.
  • A potential mitigation could involve modifying the hermes_cli/webhook.py to use gateway.config.load_gateway_config() for determining webhook state, ensuring consistency with the gateway's configuration approach.
  • Another approach could be to enhance the webhook CLI path to apply WEBHOOK_* environment overrides before checking platforms.webhook, aligning it with the gateway's behavior.

Example

No explicit code example is provided due to the need for a comprehensive understanding of the Hermes project's structure and the specific requirements for integrating environment variable overrides into the CLI config loading.

Notes

The suggested fixes imply changes to the Hermes project's codebase, specifically in how configuration is loaded and applied across different components. This might require careful consideration of the project's architecture and potential impacts on other features or configurations.

Recommendation

Apply a workaround by ensuring that platforms.webhook is explicitly defined in ~/.hermes/config.yaml until a permanent fix is implemented upstream, as this provides a temporary alignment between the gateway and CLI configurations.

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

hermes - ✅(Solved) Fix Bug: `hermes webhook list` ignores `WEBHOOK_*` env-based runtime config and reports webhook disabled [1 pull requests]