From 94250e9dda27d14972a06758d32dec829cabdbe2 Mon Sep 17 00:00:00 2001 From: hmo Date: Sun, 19 Jul 2026 09:25:25 +0800 Subject: [PATCH] fix: match crontab entries by script filename (underscore) not task name (hyphen) --- gateway/scripts/dashboard.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gateway/scripts/dashboard.py b/gateway/scripts/dashboard.py index 05504a7..8c8e33a 100644 --- a/gateway/scripts/dashboard.py +++ b/gateway/scripts/dashboard.py @@ -832,9 +832,13 @@ def api_monitor(): else: result["tier2"] = {"status": "no_data", "note": f"{t2_file} 不存在", "summary": {"ok": 0, "total": 0}} # 定时任务状态 - expected_tasks = ["agents-health-check", "agents-daily-health", "agents-todo-executor"] + expected_tasks = [ + ("agents-health-check", "agents_health_check.py"), + ("agents-daily-health", "agents_daily_health.py"), + ("agents-todo-executor", "self_todo_executor.py"), + ] if sys.platform == "win32": - for name in expected_tasks: + for name, filename in expected_tasks: try: r = subprocess.run(["schtasks", "/Query", "/TN", name, "/FO", "CSV", "/NH"], capture_output=True, text=True, timeout=5, @@ -845,10 +849,10 @@ def api_monitor(): result["tasks"].append({"name": name, "status": status}) else: # Linux: 直接检查本地 crontab(不在 Windows 上跑了) - for name in expected_tasks: + for name, filename in expected_tasks: try: r = subprocess.run(["crontab", "-l"], capture_output=True, text=True, timeout=5) - if name in r.stdout: + if filename in r.stdout: result["tasks"].append({"name": name, "status": "cron_ok"}) else: result["tasks"].append({"name": name, "status": "not_deployed"})