NousResearch/hermes-agent

Gateway process detection and restart corrections

Cluster 1830 · gateway. Data as of

Nothing open on GitHub. Fix merged in #1908 on 18 Mar 2026. Check it covers your case.

The short answer

0open issues
0open PRs
3items grouped
Known?
Yes. 3 related items grouped here, 1 issue already closed.
Fix event
A fix was merged to main in PR #1908. Check it covers your case. No release data is tracked.
Tracker
The maintainers' tracker marks this resolved, deciding PR #1908. That is separate from the fix event.
Still open
Nothing open on GitHub.

These items address bugs where the gateway's --replace and restart logic could not detect script-style gateway processes, potentially allowing duplicate instances and missed shutdowns, with additional corrections for silent outages on Windows.

Open issues0

No open issues.

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #1908 fix(gateway): detect script-style gateway processes for --replace

    merged to main

    files: gateway/status.py, hermes_cli/gateway.py, tests/gateway/test_status.py

    Show the diff
    • gateway/status.py
      @@ -87,6 +87,7 @@ def _looks_like_gateway_process(pid: int) -> bool:
       
           patterns = (
               "hermes_cli.main gateway",
      +        "hermes_cli/main.py gateway",
               "hermes gateway",
               "gateway/run.py",
           )
      @@ -105,6 +106,7 @@ def _record_looks_like_gateway(record: dict[str, Any]) -> bool:
           cmdline = " ".join(str(part) for part in argv)
           patterns = (
               "hermes_cli.main gateway",
      +        "hermes_cli/main.py gateway",
               "hermes gateway",
               "gateway/run.py",
           )
    • hermes_cli/gateway.py
      @@ -31,6 +31,7 @@ def find_gateway_pids() -> list:
           pids = []
           patterns = [
               "hermes_cli.main gateway",
      +        "hermes_cli/main.py gateway",
               "hermes gateway",
               "gateway/run.py",
           ]
    • tests/gateway/test_status.py
      @@ -42,6 +42,26 @@ def test_get_running_pid_accepts_gateway_metadata_when_cmdline_unavailable(self,
       
               assert status.get_running_pid() == os.getpid()
       
      +    def test_get_running_pid_accepts_script_style_gateway_cmdline(self, tmp_path, monkeypatch):
      +        monkeypatch.setenv("HERMES_HOME", str(tmp_path))
      +        pid_path = tmp_path / "gateway.pid"
      +        pid_path.write_text(json.dumps({
      +            "pid": os.getpid(),
      +            "kind": "hermes-gateway",
      +            "argv": ["/venv/bin/python", "/repo/hermes_cli/main.py", "gateway", "run", "--replace"],
      +            "start_time": 123,
      +        }))
      +
      +        monkeypatch.setattr(status.os, "kill", lambda pid, sig: None)
      +        monkeypatch.setattr(status, "_get_process_start_time", lambda pid: 123)
      +        monkeypatch.setattr(
      +            status,
      +            "_read_process_cmdline",
      +            lambda pid: "/venv/bin/python /repo/hermes_cli/main.py gateway run --replace",
      +        )
      +
      +        assert status.get_running_pid() == os.getpid()
      +
       
       class TestGatewayRuntimeStatus:
           def test_write_runtime_status_overwrites_stale_pid_on_restart(self, tmp_path, monkeypatch):

1 PR closed without merging

From the close comments: merged via another change 1

  • #1831 fix(gateway): detect script-style gateway processes for --replace · merged via another change → #1908
Closed issues · 1
  • Closed#1830[Bug]: gateway --replace can miss existing script-style gateway processes, allowing duplicate instances and duplicate Discord replies
How this cluster was grouped
  • Link evidence (structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
  • Pairwise link density 0.67: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

Pick up a Lab task

Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.

Open the Lab

At a glance

Subsystem
gateway
Merged PRs
#1908
Closed issues
1
Attempts
1 PR closed without merging
Fix link checked
18 Mar 2026. This confirmation is old and may be out of date (a revert or reopen would not have invalidated it here); re-verify.

For your agent

The same facts, typed.