fix(presence): pgrep Scanner erkennt hermes-Binary ohne .py-Endung (V8.9)

Bug: _pgrep_hermes_subagents() verlangte arg.endswith('.py') fuer
Python-gestartete hermes-Prozesse. Das schlug fehl bei argv wie
['python3', '/home/bernd/.local/bin/hermes', 'chat', '--profile', 'rainer']
weil 'hermes' ein Binary/Script ohne .py-Endung ist.

Fix: os.path.basename(arg) == 'hermes' statt
'hermes' in basename AND endswith('.py').

Tests: 5 neue Tests in TestPgrepArgvParsing:
- hermes-Binary in argv (Rainers realer Fall)
- generischer Pfad /pfad/zu/hermes
- direktes argv0='hermes'
- -m hermes_cli.main (bestehender Pfad intakt)
- non-hermes Python wird nicht gematcht
This commit is contained in:
Bernd (Hermes)
2026-08-02 18:10:18 +02:00
parent af21f914ae
commit f50d12b30c
2 changed files with 84 additions and 1 deletions
+1 -1
View File
@@ -1649,7 +1649,7 @@ class DetectionTimer:
if argv[i + 1].startswith("hermes_cli"):
is_hermes_python = True
break
elif "hermes" in os.path.basename(arg) and arg.endswith(".py"):
elif os.path.basename(arg) == "hermes":
is_hermes_python = True
break
if is_hermes_python: