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

Recognize hermes_cli/main.py gateway command lines in gateway
process detection and PID validation so --replace reliably finds
existing gateway instances.

Adds a regression test covering script-style cmdline detection.

Closes #1830
This commit is contained in:
TheSameCat2 2026-03-17 17:54:51 -05:00 committed by Test
parent ee4cc8ee3b
commit 5c4c4b8b7d
3 changed files with 23 additions and 0 deletions

View file

@ -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",
)