Files
hermes-agent/hermes_cli
HexLab98 a399004bf3 fix(gateway): disarm the startup watchdog when gateway run hands off to s6
`docker run <image> gateway run` arms the OOF-298 startup-liveness
watchdog in hermes_cli.main's argv fast-path (argv literally carries the
adjacent `gateway run` tokens), then `_maybe_redirect_run_to_s6_supervision`
hands the real gateway to s6 and keeps the CMD process alive as a
heartbeat. That process never reaches a GatewayRunner, so the disarm site
in `GatewayRunner.start()` is unreachable for it.

On the `os.execvp("sleep", ...)` path the image swap takes the watchdog
thread with it, so the leak is invisible. On the #36208 fallback it is
fatal: `_block_until_terminated()` parks on `signal.pause()` with ~zero
CPU and no progress lease — the exact parked-deadlock signature — so the
watchdog fires on schedule and `os._exit(75)`s the container's main
process. /init tears the container down every deadline while the
supervised gateway underneath is healthy, and the forensic record blames
a startup that finished minutes earlier.

Disarm at the handoff, before either heartbeat: once s6 owns the gateway,
this process has no pre-loop window left to cover.

(cherry picked from commit 502a501791cffa198deaf9e6b748ebdf8de3ae75)
2026-09-19 00:43:49 +05:30
..
…
…
…
…
…