fix: gateway status card shows 'not running' when no platforms connected#1757
fix: gateway status card shows 'not running' when no platforms connected#1757skspade wants to merge 3 commits intonesquena:masterfrom
Conversation
Use agent_health.build_agent_health_payload() as the authoritative running signal instead of bool(identity_map). An empty identity_map means zero connected messaging platforms, not that the gateway is down. Falls back to identity_map heuristic when agent_health module is unavailable (e.g. WebUI-only deployments).
|
Reading A few observations after reading the agent-health helper end to end: The
|
…unning - Backend: return `configured` field alongside `running`. When alive=None (no gateway metadata), configured=false with fallback to identity_map heuristic. - Frontend: amber "Gateway not configured" when configured=false, red "Gateway not running" only when configured but process is down, green "Running" when both true. - Replace dead try/except fallback with explicit tri-state check on health["alive"]. - Add regression test for last_active guard when alive=true and identity_map is empty. All 87 gateway-related tests pass.
|
Addressed all three points in 4aca1d2:
All 87 gateway tests pass. The "what to do when |
|
Thanks @skspade — this shipped in v0.51.14 (commit Your PR's CHANGELOG entry was a redundant addition since stage writes the v0.51.14 changelog at stamp time; the conflict on CHANGELOG was auto-resolved by dropping that one commit. The actual code fix shipped intact. GitHub didn't auto-close because the merge commit only references the squash-merged stage branch, not your fork's commit directly — closing manually for hygiene. Live now on existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.14 |
…ing when no platforms connected by @skspade
nesquena#1757, nesquena#1760, nesquena#1761) Constituent PRs: - nesquena#1760 (@ai-ag2026) preserve pending user turn on stream errors. Closes nesquena#1361. - nesquena#1761 (@dso2ng) scope terminal stream cleanup to owner session. Refs nesquena#1694. AUTO-FIX applied: restored !INFLIGHT[S.session.session_id] disjunct in _setActivePaneIdleIfOwner (regression introduced by helper centralization). - nesquena#1756 (@ng-technology-llc) isolate profile cookie per webui instance. Closes nesquena#803. - nesquena#1757 (@skspade) tri-state gateway status (alive: True/False/None). Tests: 4642 → 4662 collected (+20). 4649 passed, 9 skipped (test-isolation prong-2 noise), 3 xpassed, 0 failed in 152s. Pre-release verification: - All 4 PRs CI-green or rebased clean (nesquena#1757 had stale base; CHANGELOG conflict auto-resolved by dropping the PR's redundant entry). - node -c clean on static/messages.js + static/panels.js. - 11/11 browser API endpoints PASS. - Pre-stamp re-fetch: all PR heads match local rebases. - Opus advisor: SHIP, all 5 verification questions clean, 0 MUST-FIX, 0 SHOULD-FIX. - Two NICE-TO-HAVE coverage gaps absorbed in-release: (1) test_sprint36.py asserts !INFLIGHT[...] disjunct in helper body (2) test_issue1361_cancel_data_loss.py adds structural-grep test to pin _materialize_pending_user_turn_before_error call sites at error branches. Closes nesquena#803, nesquena#1361, nesquena#1694.
fix: gateway status card shows 'not running' when no platforms connected
Thinking Path
process is alive and which messaging platforms are connected
bool(identity_map)— a truthiness check on connectedplatform sessions
down, but
bool({})is False — so the UI showed "Gateway not running" whenthe gateway was actually alive and just had no active platform sessions
agent_health.build_agent_health_payload()which reads gateway.status metadata directly, then adds a
configuredtri-stateso the frontend can distinguish "not running" from "not configured at all"
What Changed
api/routes.py— handler for/api/gateway/statusnow callsbuild_agent_health_payload()and reads the tri-statealivefield (True /False / None) instead of
bool(identity_map). Falls back to the identity_mapheuristic when
aliveis None (gateway not configured — e.g. WebUI-onlydeployments). Adds a new
configuredkey to the JSON response.static/panels.js—loadGatewayStatus()checksr.configuredfirst;shows an amber "Gateway not configured" state when the gateway isn't set up.
The red "Gateway not running" state is now gated behind
!r.configuredbeingfalse, so it only shows when the gateway is configured but its process is down.
tests/test_gateway_status_agent_health.py(new, 247 lines, 10 tests) —Regression suite covering:
runningandconfiguredkeyslast_activeis empty when no sessions path existsWhy It Matters
Users who deploy Hermes with the gateway process but haven't connected any
messaging platforms yet see a red "not running" indicator and may waste time
debugging a non-issue. Users who deploy WebUI without the gateway at all see
the same misleading state. The fix gives three distinct states: running (green),
not running (red, gateway configured but process down), and not configured
(amber, no gateway setup expected).
Verification
Manual verification:
or green (depending on gateway.status metadata), not red "not running"
Risks / Follow-ups
alive=Nonefallback path preserves the existingbool(identity_map)behavior for deployments whereagent_healthmoduleisn't available (e.g. WebUI-only), so this is strictly additive.
configuredkey is new in the JSON response; external consumers of/api/gateway/statusthat don't expect it will ignore it silently.can be in.
Model Used