hermes - 💡(How to fix) Fix Background terminal processes lose tracking after gateway restart

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…
RAW_BUFFERClick to expand / collapse

Problem

When the gateway restarts (config change, crash recovery, systemd restart), all terminal(background=true) processes lose their tracking. The OS process may survive (re-parented to init) but Hermes can no longer poll/log/wait/kill it via the process tool. Additionally, systemd-managed gateway restarts kill the entire cgroup, destroying all child processes.

Steps to Reproduce

  1. Start a long-running background process: terminal(command="sleep 600 && echo done", background=true, notify_on_complete=true)
  2. Restart the gateway: hermes gateway restart
  3. Try to poll the process: process(action="poll", session_id="...") → process not found

Expected Behavior

Background processes should either:

  • Survive gateway restarts and be re-attachable, OR
  • Be explicitly checkpointed so the agent knows what was running and can resume

Actual Behavior

  • Process tracking is in-memory in the gateway process; lost on restart
  • systemd Restart=on-failure cleans the cgroup, killing all child processes
  • No mechanism to recover or reconnect to orphaned background processes

Impact

Long-running tasks (ML training, data processing, batch operations) are lost on any gateway restart. Users must manually restart everything.

Related

  • #11614: Gateway exits when Telegram disconnects, killing embedded cron ticker
  • #25738: Dashboard chat runs should survive browser disconnects
  • #29129: WhatsApp bridge drops messages on restart

Environment

  • OS: Ubuntu 24.04 (WSL2)
  • Hermes version: latest
  • systemd user service

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