hermes - 💡(How to fix) Fix [Bug]: `/restart` silently fails on Windows when no Scheduled Task is installed

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…

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

This CLI command dispatches through gateway_windows.restart()stop()start().

Code Example

-

---



---

hermes.EXE gateway restart

---

if not task_installed and not startup_installed:
    from hermes_cli.setup import prompt_yes_no
    print("✗ Gateway service is not installed")
    if not prompt_yes_no("  Install it now so the gateway starts on login?", True):
        print("  Run: hermes gateway install")
        return  # <-- exits without starting the gateway
RAW_BUFFERClick to expand / collapse

Bug Description

When the /restart slash command is sent from any messaging platform (Telegram, Discord, etc.) on a Windows gateway that was started manually (hermes gateway run) without first running hermes gateway install to register a Scheduled Task, the gateway shuts down cleanly but never comes back up. The only visible symptom is a brief blank cmd.exe window flashing on screen with the hermes.exe path as the title, then disappearing. The user must manually run hermes gateway run again to recover the gateway.

Steps to Reproduce

  1. Start gateway manually: hermes gateway run
  2. Send /restart from any connected messaging platform (Telegram, Discord, etc.)
  3. Gateway shuts down but never comes back up
  4. A blank cmd.exe window briefly appears titled hermes.EXE, then closes

Expected Behavior

Gateway drains, shuts down, and restarts automatically.

Actual Behavior

  • Gateway shuts down (drain + disconnect works correctly)
  • A blank console window flashes with the path C:\...\venv\Scripts\hermes.EXE as the title
  • No gateway process is respawned
  • User must manually run hermes gateway run again to recover

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

-

Operating System

Windows 11

Python Version

3.11.14

Hermes Version

v0.14.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The /restart command in gateway/run.py (_launch_detached_restart_command) spawns a watcher subprocess that polls the old gateway PID, then respawns it. On Windows, the watcher runs:

hermes.EXE gateway restart

This CLI command dispatches through gateway_windows.restart()stop()start().

In start() (hermes_cli/gateway_windows.py:979), when no Scheduled Task or Startup entry is registered, it falls into an interactive prompt path:

if not task_installed and not startup_installed:
    from hermes_cli.setup import prompt_yes_no
    print("✗ Gateway service is not installed")
    if not prompt_yes_no("  Install it now so the gateway starts on login?", True):
        print("  Run: hermes gateway install")
        return  # <-- exits without starting the gateway

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

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