hermes-agent/gateway
Teknium 402d048eb6 fix(gateway): also unlink stale PID + lock files on cleanup
Follow-up for salvaged PR #14179.

`_cleanup_invalid_pid_path` previously called `remove_pid_file()` for the
default PID path, but that helper defensively refuses to delete a PID file
whose pid field differs from `os.getpid()` (to protect --replace handoffs).
Every realistic stale-PID scenario is exactly that case: a crashed/Ctrl+C'd
gateway left behind a PID file owned by a now-dead foreign PID.

Once `get_running_pid()` has confirmed the runtime lock is inactive, the
on-disk metadata is known to belong to a dead process, so we can force-unlink
both the PID file and the sibling `gateway.lock` directly instead of going
through the defensive helper.

Also adds a regression test with a dead foreign PID that would have failed
against the previous cleanup logic.
2026-04-22 16:33:46 -07:00
..
builtin_hooks
…
platforms feat(gateway): expose plugin slash commands natively on all platforms + decision-capable command hook 2026-04-22 16:23:21 -07:00
__init__.py
…
channel_directory.py
…
config.py feat(gateway/slack): add SLACK_REACTIONS env toggle for reaction lifecycle 2026-04-22 08:49:24 -07:00
delivery.py
…
display_config.py
…
hooks.py feat(gateway): expose plugin slash commands natively on all platforms + decision-capable command hook 2026-04-22 16:23:21 -07:00
mirror.py
…
pairing.py
…
restart.py
…
run.py fix(gateway): recover stale pid and planned restart state 2026-04-22 16:33:46 -07:00
session.py fix: preserve reasoning_content on Kimi replay 2026-04-22 04:31:59 -07:00
session_context.py fix(cron): run due jobs in parallel to prevent serial tick starvation (#13021) 2026-04-20 11:53:07 -07:00
status.py fix(gateway): also unlink stale PID + lock files on cleanup 2026-04-22 16:33:46 -07:00
sticker_cache.py
…
stream_consumer.py
…