fix: tighten gateway-lifecycle regex with command-boundary anchors - #77571
fix: tighten gateway-lifecycle regex with command-boundary anchors#77571eaglezzz0522-cloud wants to merge 1 commit into
Conversation
…ousResearch#77173) Add ^|[\s;&|\n] prefix and \b suffix to the Branch A regex so that 'hermes gateway restart' in legitimate paths (e.g. a file path or comment) is not incorrectly blocked. The change is non-functional for normal shell usage — only prevents false positives from embedded text. Closes NousResearch#77173
Duplicate of #77536 — the current live one-line lifecycle-guard diff is identical. |
SummaryTwo open PRs reference Issue #77173, but both make the same narrow Branch A regex change. Neither diff addresses the reported _read_referenced_script() causes: directory false-positives, native-binary size handling, or the Branch D termination-pattern gap. Related pull requests
Duplicates#77571 is diff-identical to #77536 and should be treated as its duplicate, as confirmed by the [contributor:184 commits] review on #77571. Suggested consolidationKeep open with a salvage path for #77536: retain the narrow Branch A boundary refinement, correct its scope claims, add regression coverage for whitespace-prefixed comments, and retarget or split it from Issue #77173. Close #77571 as a duplicate of #77536; neither PR should be merged as the fix for the documented issue causes. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I77173(["issue #77173 (open)"])
P77571["PR #77571 (open)"]
P77571 -->|fixes| I77173
class I77173 open
class P77571 open
class P77571 target
click I77173 "https://github.com/NousResearch/hermes-agent/issues/77173"
click P77571 "https://github.com/NousResearch/hermes-agent/pull/77571"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 2 kB of PR diffs, 3 kB of issue/PR text, 1 kB of discussion (3 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
The Branch A regex in
lifecycle_guard.pythat blockshermes gateway restart/stopinside gateway sessions was too loose — it could flaghermes gateway restartembedded in file paths, comments, or other text. Adding command-boundary anchors prevents false positives.Changes
cron/lifecycle_guard.py: changer"(?:hermes\s+gateway\s+(?:restart|stop))"tor"(?:^|[\\s;&|\\n])hermes\s+gateway\s+(?:restart|stop)\b"^|[\\s;&|\\n]prefix ensures the match starts at a command boundary\bsuffix ensures partial matches (e.g.stopping) arent caughtVerification
hermes gateway restartat start of line, after;,&&,||, newlinehermes_gateway_restart.shno longer matchCloses #77173