HERMES-GIELIE/api
Sanjay Santhanam efcfff3d7f fix(#1879): cross-container gateway liveness via state-file freshness
The dashboard banner 'Hermes agent is not responding' fires on every
multi-container deployment that doesn't set 'pid: "service:hermes-agent"'
in compose, because get_running_pid() relies on fcntl.flock and
os.kill(pid, 0) — both PID-namespace-scoped and invisible across container
boundaries.

Fix: when get_running_pid() returns None, fall back to a freshness check on
gateway_state.json. The gateway already writes that file on every tick with
gateway_state == 'running' and an aware ISO-8601 updated_at timestamp, so a
recent (<= 120s) timestamp is an equivalent live-process signal that needs
only a shared volume — no PID namespace, no compose workaround, no extra
HTTP probe URL.

Behavior preserved:
- In-namespace deployments still hit the PID-based path first; payload shape
  unchanged (no 'reason' key) so #716 contract holds.
- Cross-container alive path adds reason='cross_container_freshness' so
  support diagnostics can tell which signal succeeded.
- Stale updated_at, non-running gateway_state, malformed/naive/missing
  timestamps, and timestamps far in the future all still report 'down' — the
  fallback never produces a false positive.
- Same redaction rules: argv/command/executable/env/raw pid never leak.

Tests: 15 new cases in test_issue1879_cross_container_gateway_liveness.py
covering the cross-container alive path, every refusal case, clock-skew
tolerance, and backward compat with the #716 PID path. Existing #716
heartbeat tests (8) continue to pass.
2026-05-08 15:15:50 +00:00
..
__init__.py
agent_health.py fix(#1879): cross-container gateway liveness via state-file freshness 2026-05-08 15:15:50 +00:00
agent_sessions.py fix: keep cross-surface session continuations visible 2026-05-07 16:58:39 +00:00
auth.py fix: keep frontend routes under subpath mounts 2026-05-04 00:06:58 -07:00
background.py
clarify.py feat(clarify): SSE long-connection for real-time clarify notifications (#1355) 2026-04-30 21:32:51 +00:00
commands.py
config.py stage-313 absorb: gate _resolve_configured_provider_id alias resolution + harden bootstrap test isolation 2026-05-07 17:07:48 +00:00
dashboard_probe.py feat: link official Hermes dashboard 2026-05-05 01:23:55 +00:00
extensions.py Opus pre-release follow-ups for PR #1445 2026-05-02 03:49:40 +00:00
gateway_watcher.py release: v0.50.241 (#1293) 2026-04-29 19:54:07 -07:00
helpers.py fix: add cdn.jsdelivr.net to CSP connect-src to allow xterm source map fetches 2026-05-07 20:42:55 +00:00
kanban_bridge.py stage-315 absorb: document handle_kanban_* three-valued return contract 2026-05-07 18:52:01 +00:00
metering.py fix: show TPS in assistant message headers 2026-05-04 21:26:43 +00:00
models.py fix: persist generated title refresh marker 2026-05-08 01:36:10 +02:00
oauth.py fix(oauth): serialize Anthropic env fallback reads 2026-05-07 02:47:19 +00:00
onboarding.py feat: link Claude Code OAuth in onboarding 2026-05-06 06:26:43 +00:00
profiles.py fix: allow profile switching during active streams 2026-05-06 16:11:46 +00:00
providers.py Stage 314: PR #1827 — sync Codex provider card models with picker by @Michaelyklam 2026-05-07 17:58:52 +00:00
rollback.py v0.50.255: Opus follow-ups (4 fixes) + CHANGELOG 2026-05-01 17:19:53 +00:00
routes.py fix: preserve pending turn during stale cleanup 2026-05-07 23:57:01 +02:00
session_ops.py Show profile home in /status command (refs #463) (#1380) 2026-05-01 04:46:37 +00:00
session_recovery.py fix: absorb Opus advisor doc-only SHOULD-FIX nits 2026-05-03 20:54:02 +00:00
startup.py fix: P0 hotfixes — API regression, code block parser, chmod override 2026-05-01 12:10:48 +00:00
state_sync.py
streaming.py fix: show auto-compression running state 2026-05-07 18:41:13 +00:00
system_health.py feat: add VPS resource health panel 2026-05-05 17:30:56 +00:00
terminal.py
updates.py fix: normalize update banner repository URLs 2026-05-05 08:29:00 -07:00
upload.py
workspace.py fix: preserve inaccessible workspace entries 2026-05-07 16:56:48 +00:00