diff --git a/CHANGELOG.md b/CHANGELOG.md index 42919130..6acc7063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## [Unreleased] +### Fixed + +- Gateway status now treats existing messaging-session metadata as configured when `gateway.status` is unavailable, avoiding a misleading "Gateway not configured" warning for multi-container deployments with active gateway sessions. + ## [v0.51.134] — 2026-05-25 — Release DF (stage-batch16 — single-PR Windows path defaults) ### Fixed diff --git a/api/routes.py b/api/routes.py index 8140f3f9..bbce9aba 100644 --- a/api/routes.py +++ b/api/routes.py @@ -4754,7 +4754,7 @@ def handle_get(handler, parsed) -> bool: configured = True else: # alive is None → gateway not configured / unavailable running = bool(identity_map) - configured = False + configured = bool(identity_map) platforms_set: set[str] = set() for meta in identity_map.values(): diff --git a/tests/test_gateway_status_agent_health.py b/tests/test_gateway_status_agent_health.py index 843f7cd5..66a70f45 100644 --- a/tests/test_gateway_status_agent_health.py +++ b/tests/test_gateway_status_agent_health.py @@ -124,7 +124,8 @@ def test_gateway_status_running_true_and_platforms_when_agent_health_alive_and_s def test_gateway_status_alive_none_falls_back_to_identity_map_heuristic(monkeypatch): """When alive=None (not configured) but sessions exist, running reflects identity_map. - configured=false tells the frontend to show 'not configured' state.""" + configured=true because sessions metadata proves a gateway is configured + even if gateway.status cannot be imported in this WebUI process.""" from api import routes monkeypatch.setattr( @@ -144,8 +145,8 @@ def test_gateway_status_alive_none_falls_back_to_identity_map_heuristic(monkeypa result = handler.get_json() # Fallback to identity_map: sessions exist → running=true assert result["running"] is True - # But configured=false because alive was None (no gateway metadata) - assert result["configured"] is False + # Existing gateway sessions prove the gateway has been configured. + assert result["configured"] is True def test_gateway_status_handles_corrupted_sessions_json(monkeypatch): @@ -244,4 +245,4 @@ def test_gateway_status_last_active_empty_when_alive_and_no_sessions_path(monkey assert result["configured"] is True # In test context, sessions_path won't exist (no real filesystem), # so last_active must be empty. - assert result["last_active"] == "" \ No newline at end of file + assert result["last_active"] == ""