Skip to content

fix(cli): arm detached relaunch for agent-initiated Windows restart - #110475

Open
lEWFkRAD wants to merge 1 commit into
NousResearch:mainfrom
lEWFkRAD:fix/99215-detached-relaunch-v3
Open

fix(cli): arm detached relaunch for agent-initiated Windows restart#110475
lEWFkRAD wants to merge 1 commit into
NousResearch:mainfrom
lEWFkRAD:fix/99215-detached-relaunch-v3

Conversation

@lEWFkRAD

Copy link
Copy Markdown
Contributor

Summary

Fixes #99215 on Windows by detecting when hermes gateway restart is running beneath the gateway process it is about to stop. In that descendant case, the CLI arms the detached restart watcher before stopping the gateway and replays each gateway's live gateway run argv. Restarts from a clean shell keep the existing synchronous stop/wait/start path.

This replaces stale PR #99386, rebuilt onto current main after upstream gateway lifecycle changes.

Verification

  • tests/hermes_cli/test_gateway_windows.py: 15 passed
  • Adds 6 regression tests covering ancestor detection, detached-watch arming, argv replay, non-gateway rejection, and synchronous fallback.
  • Adjacent-suite control:
    • patched branch: 61 failed, 245 passed
    • vanilla origin/main: 61 failed, 236 passed
    • identical 61 pre-existing failures; this change adds 9 passes and no new failures.

Behavior

  • Agent-initiated restart: arm detached watcher, then stop; current turn may terminate while the watcher restores the gateway.
  • Shell-initiated restart: unchanged synchronous behavior.

…n Windows (NousResearch#99215)

A 'hermes gateway restart' issued from a gateway-hosted agent turn runs as a child of the gateway it stops, so the stop path tears the restart command down before it reaches its own start() -- a silent outage with nothing to relaunch (NousResearch#99215). Detect the descendant case via the ancestor chain and arm the detached restart watcher BEFORE stopping, replaying each gateway's own live 'gateway run' argv. A restart from a clean shell keeps the original synchronous stop/wait/start flow. Rebuilt onto current main from 500b6d3; adds 6 regression tests. Co-authored-by: Hermes Agent <agent@nousresearch.com>
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: gateway restart triggered from an agent tool call stops the gateway but never relaunches it

2 participants