diff --git a/apps/api/src/services/telegram_gateway.py b/apps/api/src/services/telegram_gateway.py index 288b5a18..f58066cd 100644 --- a/apps/api/src/services/telegram_gateway.py +++ b/apps/api/src/services/telegram_gateway.py @@ -1000,25 +1000,28 @@ class InfraAlertMessage: 按鈕: 無 (資訊型告警) """ component: str # 元件名稱 (e.g., "Nemotron NIM") - status: str # 狀態描述 (e.g., "⚠️ 超時 (>10s)") + status: str # 狀態描述 (e.g., "⚠️ 超時 (>25s)") impact: str # 影響說明 auto_fixed: bool = False # 是否已自動修復 - fix_action: str = "" # 執行的修復動作 + fix_action: str = "" # 執行的修復動作 (auto_fixed=True 時顯示) + note: str = "" # 附加說明 (info_only 情境用,不顯示修復區塊) def format(self) -> str: """格式化為 Telegram HTML""" - fix_block = "" - if self.auto_fixed: - fix_block = f"━━━━━━━━━━━━━━━━━━━\n✅ 已自動修復\n└ {html.escape(self.fix_action[:100])}\n" + # 有 note 表示「資訊性提示」,不顯示修復區塊 + if self.note: + footer = f"━━━━━━━━━━━━━━━━━━━\n💡 {html.escape(self.note[:150])}\n" + elif self.auto_fixed: + footer = f"━━━━━━━━━━━━━━━━━━━\n✅ 已自動修復\n└ {html.escape(self.fix_action[:100])}\n" else: - fix_block = f"━━━━━━━━━━━━━━━━━━━\n❌ 自動修復失敗\n└ {html.escape(self.fix_action[:100] or '無可用修復方案')}\n" + footer = f"━━━━━━━━━━━━━━━━━━━\n⚠️ 需要關注\n└ {html.escape(self.fix_action[:100] or '請確認元件狀態')}\n" return ( f"🚨 基礎設施異常\n" f"━━━━━━━━━━━━━━━━━━━\n" f"⚙️ {html.escape(self.component)}: {html.escape(self.status)}\n" f"📛 影響: {html.escape(self.impact[:150])}\n" - f"{fix_block}" + f"{footer}" )[:900] @@ -3028,9 +3031,8 @@ class TelegramGateway: alert = InfraAlertMessage( component="Nemotron NIM (NVIDIA API)", status=nemo_status, - impact="NIM 回應慢於探測 timeout,incident 分析可能延遲", - auto_fixed=False, - fix_action="無需自動修復,NIM 免費 tier 延遲 11-45s 屬正常範圍", + impact="NIM 免費 tier 回應慢 (11-45s),@nemo 對話可能需等待", + note="NIM 慢屬正常 — 免費 tier 特性,非故障。如需快速回應請用 @openclaw", ) await self.send_notification(alert.format(), parse_mode="HTML") logger.warning("nemotron_health_slow_alert", status=nemo_status) diff --git a/k8s/awoooi-prod/04-configmap.yaml b/k8s/awoooi-prod/04-configmap.yaml index 49a0cba2..5095ddd4 100644 --- a/k8s/awoooi-prod/04-configmap.yaml +++ b/k8s/awoooi-prod/04-configmap.yaml @@ -67,9 +67,9 @@ data: # ============================================================================ SHADOW_MODE_ENABLED: "false" SHADOW_MODE_LOG_ONLY: "false" - # 2026-04-01 ogt: 改回 false — OpenClaw(188) 是唯一 Polling 實例,K8s 只發送訊息 - # 舊設計「K8s 接管」已廢棄,兩個 polling 造成 409 Conflict - TELEGRAM_ENABLE_POLLING: "false" + # 2026-04-03 ogt: 改為 true — clawbot-v5 已設 STANDBY_MODE,AWOOOI API 接管 Polling + # Phase 22.6: 統帥需要直接在同一 Bot 與 OpenClaw/NemoClaw 雙 AI 對話 + TELEGRAM_ENABLE_POLLING: "true" # 快取 TTL (秒) CACHE_TTL_DASHBOARD: "300"