補齊自癒稽核與 OpenClaw 記憶閉環
All checks were successful
CD Pipeline / deploy (push) Successful in 1m16s

This commit is contained in:
OoO
2026-04-29 23:02:06 +08:00
parent 1c2dc6cd61
commit f0e044aa48
4 changed files with 241 additions and 23 deletions

View File

@@ -2059,6 +2059,19 @@ def run_icaim_analysis_task():
if not result.success:
logging.error(f"[Scheduler] [ICAIM] Hermes 失敗: {result.error}")
try:
from services.event_router import notify_failure
notify_failure(
task_name="run_icaim_analysis_task",
error=RuntimeError(result.error or "Hermes analysis failed"),
source="Scheduler.ICAIM",
event_type="icaim_hermes_failure",
priority="P1",
title="ICAIM Hermes 分析失敗",
payload={"duration_sec": hermes_duration, "candidates": result.total_candidates},
)
except Exception as _router_e:
logging.error(f"[Scheduler] [ICAIM] Hermes failure event_router 失敗: {_router_e}")
return
if not result.threats:
@@ -2323,6 +2336,19 @@ def run_openclaw_meta_analysis_task():
import traceback as _tb
logging.error(f"[Scheduler] [MetaAnalysis] 🚨 Meta-Analysis 任務異常: {e}")
_save_stats('meta_analysis', {"status": "Error", "error": str(e)})
try:
from services.event_router import notify_failure
notify_failure(
task_name="run_openclaw_meta_analysis_task",
error=e,
source="Scheduler.MetaAnalysis",
event_type="openclaw_report_failure",
priority="P2",
title="OpenClaw Meta-Analysis 任務異常",
trace=_tb.format_exc(),
)
except Exception as _router_e:
logging.error(f"[Scheduler] [MetaAnalysis] event_router 失敗: {_router_e}")
try:
from services.auto_heal_service import auto_heal_service
auto_heal_service.handle_exception(
@@ -2406,6 +2432,19 @@ def run_daily_report_task():
import traceback as _tb
logging.error(f"[Scheduler] [DailyReport] 🚨 日報任務異常: {e}")
_save_stats('daily_report', {"status": "Error", "error": str(e)})
try:
from services.event_router import notify_failure
notify_failure(
task_name="run_daily_report_task",
error=e,
source="Scheduler.DailyReport",
event_type="openclaw_report_failure",
priority="P2",
title="OpenClaw 日報任務異常",
trace=_tb.format_exc(),
)
except Exception as _router_e:
logging.error(f"[Scheduler] [DailyReport] event_router 失敗: {_router_e}")
try:
from services.auto_heal_service import auto_heal_service
auto_heal_service.handle_exception(
@@ -2431,6 +2470,19 @@ def run_monthly_report_task():
import traceback as _tb
logging.error(f"[Scheduler] [MonthlyReport] 🚨 月報任務異常: {e}")
_save_stats('monthly_report', {"status": "Error", "error": str(e)})
try:
from services.event_router import notify_failure
notify_failure(
task_name="run_monthly_report_task",
error=e,
source="Scheduler.MonthlyReport",
event_type="openclaw_report_failure",
priority="P2",
title="OpenClaw 月報任務異常",
trace=_tb.format_exc(),
)
except Exception as _router_e:
logging.error(f"[Scheduler] [MonthlyReport] event_router 失敗: {_router_e}")
try:
from services.auto_heal_service import auto_heal_service
auto_heal_service.handle_exception(