diff --git a/services/aider_heal_executor.py b/services/aider_heal_executor.py index 566c17d..0e47483 100644 --- a/services/aider_heal_executor.py +++ b/services/aider_heal_executor.py @@ -154,15 +154,26 @@ def _wait_for_health( def _notify_telegram(message_html: str) -> None: - """非阻塞通知,失敗靜默忽略。""" + """ + 非阻塞通知,失敗靜默忽略。 + + ADR-019 Phase 5: 改走 EventRouter 統一入口(event_type=aider_heal_event, + severity=warning,會走 L0/L1 由 EventRouter 內部分流)。失敗仍靜默 pass, + caller 行為不變。 + """ if not TELEGRAM_BOT_TOKEN or not TELEGRAM_CHAT_ID: return try: - requests.post( - f"https://api.telegram.org/bot{TELEGRAM_BOT_TOKEN}/sendMessage", - json={"chat_id": TELEGRAM_CHAT_ID, "text": message_html, "parse_mode": "HTML"}, - timeout=5, - ) + from services.event_router import dispatch_sync + dispatch_sync(event={ + "event_type": "aider_heal_event", + "severity": "warning", + "source": "AiderHealExecutor", + "title": "Aider 自動修復通知", + "summary": message_html[:400], + "status": "heal_notification", + "payload": {"raw_message_html": message_html}, + }, admin_chat_ids=[TELEGRAM_CHAT_ID]) except Exception: pass