diff --git a/docs/PRD.md b/docs/PRD.md index 3ddd13e..45164c8 100644 --- a/docs/PRD.md +++ b/docs/PRD.md @@ -89,7 +89,7 @@ | 编号 | 问题 | 影响 | 当前措施 | 优先级 | 当前状态 | |------|------|------|----------|--------|----------| -| R01 | Gateway 进程意外退出未自动拉起 | 服务中断 | 无自动恢复 | P0 | ❌ 未修复 | +| R01 | Gateway 进程意外退出未自动拉起 | 服务中断 | 无自动恢复 | P0 | 🔄 Gateway 健康已纳入监控(I/J Tab显示), 自动拉起待 systemd 配置 | | R02 | XMPP Bot 断线后重连失败 | 消息丢失 | slixmpp reconnect 不可靠 | P0 | ✅ frp heartbeat已加 | | R03 | Provider key 过期/配额超限无告警 | LLM 调用失败 | fallback 不总能触发 | P0 | 🔄 fallback链待验证 | | R04 | Session 膨胀导致响应退化 | 回复质量下降 | 硬截断 200 条 | P1 | ✅ 硬截断200条已实现 | diff --git a/gateway/scripts/dashboard.py b/gateway/scripts/dashboard.py index eae2039..58b7a06 100644 --- a/gateway/scripts/dashboard.py +++ b/gateway/scripts/dashboard.py @@ -629,6 +629,13 @@ def api_services(): online = _ejabberd_online_jids() services.append({"name": "ejabberd", "port": 5222, "health": {"ok": len(online) > 0}, "watchdog": True, "pid_lock": False, "type": "infra", "depends_on": []}) + # remote gateways (R01 monitoring) + g1 = {"name": "gateway_mohe", "port": 8642, "health": _health_status("http://192.168.1.246:8642/v1/health"), + "watchdog": False, "pid_lock": False, "type": "gateway", "depends_on": ["ejabberd"]} + services.append(g1) + g2 = {"name": "gateway_zhiwei", "port": 8643, "health": _health_status("http://192.168.1.246:8643/v1/health"), + "watchdog": False, "pid_lock": False, "type": "gateway", "depends_on": ["ejabberd"]} + services.append(g2) # 统计 watched = sum(1 for s in services if s.get("watchdog")) return jsonify({"ok": True, "services": services, "watched": watched, "total": len(services)}) diff --git a/gateway/scripts/service_registry.py b/gateway/scripts/service_registry.py index e225339..2633c24 100644 --- a/gateway/scripts/service_registry.py +++ b/gateway/scripts/service_registry.py @@ -53,4 +53,30 @@ SERVICES = [ "log_files": lambda: [], "description": "AgentsMeeting 管理门户", }, + { + "name": "gateway_mohe", + "script": None, + "args": [], + "workdir": None, + "pid_file": None, + "port": 8642, + "health_url": "http://192.168.1.246:8642/v1/health", + "accept_401": True, # may need auth + "depends_on": ["ejabberd"], + "log_files": lambda: [], + "description": "Hermes Gateway (mohe@yoin.fun)", + }, + { + "name": "gateway_zhiwei", + "script": None, + "args": [], + "workdir": None, + "pid_file": None, + "port": 8643, + "health_url": "http://192.168.1.246:8643/v1/health", + "accept_401": True, + "depends_on": ["ejabberd"], + "log_files": lambda: [], + "description": "Hermes Gateway (zhiwei@yoin.fun)", + }, ]