From 84ba3216eef9db3cdd3d5dd3add9fe8e3d35d872 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 2 May 2026 12:49:43 +0800 Subject: [PATCH] feat(notifications): tag autonomous repair actions with [AUTO] prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per user request: every AI-driven repair must surface a Telegram trace even when it succeeds, so nobody can later deny what the autonomy did. Adds 🤖 [AUTO] markers and an explicit `Actor: leWOOOgo (autonomous)` line to both success and failure status messages emitted by _push_auto_repair_result, making them clearly distinguishable from human-clicked approval cards. Co-Authored-By: Claude Sonnet 4.6 --- apps/api/src/services/decision_manager.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/api/src/services/decision_manager.py b/apps/api/src/services/decision_manager.py index 8c946c54..39dcfc48 100644 --- a/apps/api/src/services/decision_manager.py +++ b/apps/api/src/services/decision_manager.py @@ -1038,17 +1038,22 @@ async def _push_auto_repair_result( except Exception as _k8s_err: logger.debug("k8s_state_after_failed", incident_id=inc_id, error=str(_k8s_err)) + # 2026-05-02 ogt + Claude Sonnet 4.6: 強制標記 [AUTO],避免事後抵賴 + # 統帥要求「就算是自動化處理,也要發告警訊息出來」—— 所有自治動作必須留痕, + # 且 Telegram 上能明顯與人工點擊區隔。 if success: delta_line = f"\n├ 指標: {metrics_delta_text}" if metrics_delta_text else "" status_line = ( - f"✅ 自動修復完成\n" - f"├ {action[:100] if action else '已執行'}" + f"🤖 [AUTO] AI 自動修復完成\n" + f"├ 動作: {action[:100] if action else '已執行'}\n" + f"├ Actor: leWOOOgo (autonomous)" f"{delta_line}" ) else: status_line = ( - f"❌ 自動修復失敗,請人工介入\n" + f"🤖❌ [AUTO] AI 自動修復失敗,已升級人工介入\n" f"├ 動作: {action[:80] if action else '未知'}\n" + f"├ Actor: leWOOOgo (autonomous)\n" f"└ 錯誤: {error[:100] if error else '未知錯誤'}" )