hermes - ✅(Solved) Fix profile list/show reports Gateway stopped when host-side systemd gateway is running [1 pull requests, 2 comments, 2 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
NousResearch/hermes-agent#20254Fetched 2026-05-06 06:37:47
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Root Cause

This appears to happen because profile list/show checks only the profile's gateway.pid, while the systemd-managed gateway may not have that pid file.

Fix Action

Fixed

PR fix notes

PR #20488: fix(profile): detect service-managed gateway status

Description (problem / solution / changelog)

Summary

  • keep the existing profile-scoped gateway.pid check as the fast path
  • fall back to the shared gateway runtime snapshot with HERMES_HOME temporarily scoped to the profile being displayed
  • use service-manager state for the fallback so profile list/show can detect systemd/launchd gateways without attributing unrelated gateway PIDs to the wrong profile
  • add regression coverage for the service-managed no-pid-file path

Closes #20254

Verification

  • scripts/run_tests.sh tests/hermes_cli/test_profiles.py -k gateway_running_check
  • scripts/run_tests.sh tests/hermes_cli/test_profiles.py

Non-goals

  • does not change gateway start/stop/install behavior
  • does not attempt to infer profile ownership for arbitrary manual gateway processes without a pid file

Changed files

  • hermes_cli/profiles.py (modified, +19/-1)
  • tests/hermes_cli/test_profiles.py (modified, +41/-2)
RAW_BUFFERClick to expand / collapse

Bug Description

I'm not sure if this is expected behavior or a bug, but I noticed a gateway status mismatch in a host-side systemd setup.

When Hermes Gateway is running as a host-side systemd user service, hermes profile list and hermes profile show default can report the gateway as stopped.

The actual gateway is running, and commands such as hermes gateway status and hermes cron status correctly detect it.

This appears to happen because profile list/show checks only the profile's gateway.pid, while the systemd-managed gateway may not have that pid file.

Environment

  • Hermes Agent running on host, not Docker
  • Gateway installed/running as a user systemd service
  • Service: hermes-gateway.service
  • Profile path: ~/.hermes
  • Dashboard/Web UI launched via hermes dashboard
  • Cron is also using the host-side gateway

Steps to Reproduce

  1. Run Hermes Gateway as a user systemd service:

    systemctl --user status hermes-gateway

  2. Confirm the service is active/running.

  3. Run:

    hermes profile list

  4. Run:

    hermes profile show default

Expected Behavior

profile list and profile show default should report:

Gateway: running

when the gateway is active via systemd.

Actual Behavior

They report:

Gateway: stopped

even though the gateway service is active and other commands detect it correctly.

Additional Context

Other gateway status checks appear to use different mechanisms:

  • hermes gateway status detects systemd/manual gateway state
  • hermes cron status uses gateway PID discovery and correctly reports the gateway as running
  • profile list/show appears to rely on gateway.pid
  • dashboard and send_message availability checks may also have separate gateway status logic

It may be worth centralizing gateway runtime detection into a shared helper so CLI commands, dashboard, cron, profile commands, and tools all use the same source of truth.

A safe detection order might be:

  1. Existing pid/lock file based detection
  2. systemd user service fallback
  3. system systemd service fallback
  4. Optional MainPID environment check, e.g. HERMES_HOME, to avoid matching the wrong profile

Possibly Related

I found a few related gateway status / PID detection discussions, but I could not find one specifically about profile list/show reporting stopped for a host-side user systemd gateway.

Possibly related:

  • #9385
  • #16375
  • #19127
  • #19129
  • #4776

If this is already covered by an existing issue or PR, feel free to close this as duplicate.

extent analysis

TL;DR

The hermes profile list and hermes profile show default commands may report the gateway as stopped due to relying on the presence of a gateway.pid file, which is not created when the gateway is managed by systemd.

Guidance

  • Verify that the hermes-gateway.service is indeed active and running using systemctl --user status hermes-gateway.
  • Check if the gateway.pid file is present in the expected location and if its absence is the cause of the mismatch.
  • Consider implementing a centralized gateway runtime detection mechanism that checks for the systemd service status as a fallback when the gateway.pid file is not present.
  • Review the related discussions (#9385, #16375, #19127, #19129, #4776) to see if a similar issue has been addressed or if there are existing solutions that can be applied.

Example

No code snippet is provided as the issue seems to be related to the logic of the hermes commands and their interaction with systemd, rather than a specific code error.

Notes

The issue might be specific to the combination of running Hermes Gateway as a user systemd service and using the hermes profile list and hermes profile show default commands. Centralizing gateway runtime detection could help resolve this and similar issues.

Recommendation

Apply a workaround by modifying the hermes profile list and hermes profile show default commands to also check the systemd service status when the gateway.pid file is not present, as this seems to be the root cause of the mismatch.

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 profile list/show reports Gateway stopped when host-side systemd gateway is running [1 pull requests, 2 comments, 2 participants]