From 4d8fde58567b60f720b93095b60ecaebcba3517b Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 10 Aug 2026 18:39:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mofin=5Fhealth=20cron=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E6=A3=80=E6=B5=8B=EF=BC=88hermes=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E9=9D=99=E9=BB=98=E8=A1=A5=E5=81=BF=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/mofin_health.py | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/deploy/profile-scripts/mofin_health.py b/deploy/profile-scripts/mofin_health.py index ec93e6e5..4292f18f 100644 --- a/deploy/profile-scripts/mofin_health.py +++ b/deploy/profile-scripts/mofin_health.py @@ -945,6 +945,28 @@ def build_report(): last_run = str(j.get("last_run_at", ""))[:19] schedule = j.get("schedule", {}).get("display", str(j.get("schedule",""))) no_agent = j.get("no_agent", False) + # 输出缺失检测(2026-08-10):hermes失败时last_status仍ok, + # 检查"今天应按调度运行但输出目录无当日文件"的LLM cron + output_missing = False + output_missing_reason = "" + if not no_agent and j.get("id") and j.get("enabled", True): + try: + _job_id = j.get("id") + _out_dir = Path('/home/hmo/.hermes/profiles/position-analyst/cron/output') / _job_id + if _out_dir.exists(): + _today = now.strftime("%Y-%m-%d") + _today_files = list(_out_dir.glob(f"*{_today}*")) + _last_run_str = str(j.get("last_run_at", ""))[:10] + _is_today_run = (_last_run_str == _today) + # LLM cron 今天应按调度跑(工作日)但没有今天输出 + _sched = str(j.get("schedule", "")) + _weekday_only = ("1-5" in _sched or "mon" in _sched.lower()) + _is_weekday = now.weekday() < 5 + if _is_today_run and not _today_files and (_weekday_only and _is_weekday or not _weekday_only): + output_missing = True + output_missing_reason = f"last_status={status}但今天无输出文件" + except Exception: + pass pipelines.append({ "name": name, "type": "no_agent" if no_agent else "LLM", @@ -953,7 +975,12 @@ def build_report(): "status": status, "last_run": last_run, "profile": j.get("profile", "?"), + "output_missing": output_missing, + "output_missing_reason": output_missing_reason, }) + if output_missing: + feature_tree["status"] = "fail" + feature_tree.setdefault("warn_detail", {})[name] = output_missing_reason # ── 自检体系状态(L1功能健康/L3修复记录/L4元监控/L2卫生)── self_check = {}