hermes - 💡(How to fix) Fix Telegram gateway can stay down after self-restart if launchd job is unloaded

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…

Code Example

Telegram button resolved 1 approval(s) ... choice=once

---

Stopping gateway for restart...

---

Gateway drain timed out after 60.0s with 1 active agent(s); interrupting remaining work.

---

[Telegram] Disconnected from Telegram

---

Gateway service is not loaded
Service definition exists locally but launchd has not loaded it.

---

hermes gateway start

---

launchd job was unloaded; reloading service definition
Connected to Telegram (polling mode)
Gateway running with 1 platform(s)

---

Telegram approval successfully triggers shutdown → active agent drain times out → gateway stops → launchd job is not loaded afterward → nothing restarts it until `hermes gateway start` is run manually.
RAW_BUFFERClick to expand / collapse

Bug description

The Telegram gateway can silently stay down after approving a gateway restart from inside Telegram when the macOS launchd job ends up unloaded.

This happened during a Telegram-triggered agent turn. The restart command was approved through the Telegram approval UI, the gateway began shutdown, active-agent drain timed out, Telegram disconnected cleanly, but the gateway did not come back up. Later, hermes gateway status reported that the launchd service was not loaded. Running hermes gateway start manually reloaded the launchd job and restored Telegram.

Steps / observed sequence

  1. A Telegram message triggered an agent turn.
  2. A command that restarted the Hermes gateway was approved from the Telegram approval UI.
  3. Logs show the approval was received:
Telegram button resolved 1 approval(s) ... choice=once
  1. Gateway began shutdown:
Stopping gateway for restart...
  1. It waited for active agents to drain, but timed out:
Gateway drain timed out after 60.0s with 1 active agent(s); interrupting remaining work.
  1. Telegram disconnected cleanly:
[Telegram] Disconnected from Telegram
  1. The gateway did not come back up. Later, hermes gateway status reported:
Gateway service is not loaded
Service definition exists locally but launchd has not loaded it.
  1. Running this fixed it:
hermes gateway start

The CLI reloaded the launchd job and Telegram connected again:

launchd job was unloaded; reloading service definition
Connected to Telegram (polling mode)
Gateway running with 1 platform(s)

Expected behavior

A gateway restart initiated through Telegram should either:

  • restart successfully and reconnect Telegram, or
  • fail loudly in a way that leaves a known recovery path/log message, ideally with the launchd job in a known-good loaded state.

Actual behavior

From the user side, Telegram silently stopped responding. Since the restart was initiated through Telegram itself, there was no follow-up message explaining that the gateway failed to restart.

Impact

For users running Hermes mainly through Telegram, this looks like the bot just died. The recovery is simple (hermes gateway start), but the user has to know to check the host manually.

Possible improvement ideas

  • If gateway restart detects that the launchd service is unloaded, fall back to the same reload/start behavior as gateway start.
  • For self-restarts initiated via Telegram approval buttons, acknowledge/edit the approval message before shutdown so the user knows the click was processed.
  • After restart, add a watchdog/self-check that verifies at least one platform came back online, and logs/warns loudly if not.
  • If drain times out with active agents, make sure restart still re-enters a known-good launchd state.

Environment

  • OS: macOS
  • Service manager: launchd
  • Platform: Telegram gateway
  • Hermes Agent version observed locally: v0.13.0 (2026.5.7)

Notes

The key failure mode seems to be:

Telegram approval successfully triggers shutdown → active agent drain times out → gateway stops → launchd job is not loaded afterward → nothing restarts it until `hermes gateway start` is run manually.

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…

FAQ

Expected behavior

A gateway restart initiated through Telegram should either:

  • restart successfully and reconnect Telegram, or
  • fail loudly in a way that leaves a known recovery path/log message, ideally with the launchd job in a known-good loaded state.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING