自检循环2: R01 Gateway监控 + 服务树扩展

- 新增gateway_mohe:8642 + gateway_zhiwei:8643到服务注册表
- 新增api_services返回2个Gateway的健康状态
- I功能树+J拓扑自动包含Gateway节点
- PRD R01状态: 🔄(监控已加,auto-restart待systemd)
This commit is contained in:
hmo
2026-07-14 02:49:09 +08:00
parent d743b0a274
commit 3bd50e70ea
3 changed files with 34 additions and 1 deletions
+1 -1
View File
@@ -89,7 +89,7 @@
| 编号 | 问题 | 影响 | 当前措施 | 优先级 | 当前状态 | | 编号 | 问题 | 影响 | 当前措施 | 优先级 | 当前状态 |
|------|------|------|----------|--------|----------| |------|------|------|----------|--------|----------|
| R01 | Gateway 进程意外退出未自动拉起 | 服务中断 | 无自动恢复 | P0 | ❌ 未修复 | | R01 | Gateway 进程意外退出未自动拉起 | 服务中断 | 无自动恢复 | P0 | 🔄 Gateway 健康已纳入监控(I/J Tab显示), 自动拉起待 systemd 配置 |
| R02 | XMPP Bot 断线后重连失败 | 消息丢失 | slixmpp reconnect 不可靠 | P0 | ✅ frp heartbeat已加 | | R02 | XMPP Bot 断线后重连失败 | 消息丢失 | slixmpp reconnect 不可靠 | P0 | ✅ frp heartbeat已加 |
| R03 | Provider key 过期/配额超限无告警 | LLM 调用失败 | fallback 不总能触发 | P0 | 🔄 fallback链待验证 | | R03 | Provider key 过期/配额超限无告警 | LLM 调用失败 | fallback 不总能触发 | P0 | 🔄 fallback链待验证 |
| R04 | Session 膨胀导致响应退化 | 回复质量下降 | 硬截断 200 条 | P1 | ✅ 硬截断200条已实现 | | R04 | Session 膨胀导致响应退化 | 回复质量下降 | 硬截断 200 条 | P1 | ✅ 硬截断200条已实现 |
+7
View File
@@ -629,6 +629,13 @@ def api_services():
online = _ejabberd_online_jids() online = _ejabberd_online_jids()
services.append({"name": "ejabberd", "port": 5222, "health": {"ok": len(online) > 0}, services.append({"name": "ejabberd", "port": 5222, "health": {"ok": len(online) > 0},
"watchdog": True, "pid_lock": False, "type": "infra", "depends_on": []}) "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")) watched = sum(1 for s in services if s.get("watchdog"))
return jsonify({"ok": True, "services": services, "watched": watched, "total": len(services)}) return jsonify({"ok": True, "services": services, "watched": watched, "total": len(services)})
+26
View File
@@ -53,4 +53,30 @@ SERVICES = [
"log_files": lambda: [], "log_files": lambda: [],
"description": "AgentsMeeting 管理门户", "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)",
},
] ]