fix(gateway): drop _HERMES_GATEWAY blanket guard for legit internal restarts - #37057
fix(gateway): drop _HERMES_GATEWAY blanket guard for legit internal restarts#37057drzeast-png wants to merge 1 commit into
Conversation
|
One concern worth noting before merge. Companion PR #35668 is still OPEN (not merged). The PR body states the fix depends on #35668 ("With #35668 (KeepAlive unconditional) merged, the supervisor handles respawn correctly — no agent-side guard needed"), but #35668 has not landed yet. If this PR merges first, there's a window where:
The PR body also references a companion "macOS via_service race fix" that is "incoming" — another dependency that isn't merged yet. Suggestion: ensure #35668 (and the macOS race fix companion) merge before this PR, or add a runtime check that raises an error if the guard is removed but KeepAlive is still conditional. The simpler path is just ordering the merges correctly. |
9ead0b8 to
334bd43
Compare
908816f to
23e7e55
Compare
95d84c0 to
53be66b
Compare
…estarts Allow restart/stop from inside the gateway (e.g. via WeChat/Telegram) so the user can manage the gateway remotely. Trust launchd KeepAlive as the only respawn policy; the upstream blanket guard (NousResearch#35679) blocks legitimate manual restarts. Supersedes the still-open PR NousResearch#35815 (loop-detector variant).
53be66b to
057dba6
Compare
Review notes — companion PR contextThis PR removes the However: this PR is a strict subset of #37063 (same author). That PR does both:
Recommendation: Close this PR in favor of #37063. The guard removal without the Tagging |
|
Closing in favor of #37063 (same author), which includes this change plus the macOS fix and WeChat stale-session improvements — the complete fix. |
Problem
PR #35679 added a blanket guard that refuses all
stop/restartcommands from inside the gateway process (via the_HERMES_GATEWAYenv var). The intent was to prevent the cron+KeepAlive respawn loop from #30719 — but it has the side effect of blocking legitimate manual restarts from WeChat/Telegram/etc., forcing users to SSH in or use an external terminal.Additionally, the guard does not actually prevent the original #30719 loop: cron jobs run as subprocesses that inherit
_HERMES_GATEWAY=1, but the guard triggers on the first attempt, not on the loop pattern itself.Solution
Drop the guard entirely. Trust launchd KeepAlive (or systemd Restart=always / container restart policy) as the only respawn policy. With #35668 (KeepAlive unconditional) merged, the supervisor handles respawn correctly — no agent-side guard needed.
Behavior comparison
Companion PRs
Supersedes
Test plan
hermes gateway restartnow succeeds