diff --git a/apps/api/src/services/telegram_gateway.py b/apps/api/src/services/telegram_gateway.py index 4de6fa98..ce3a754e 100644 --- a/apps/api/src/services/telegram_gateway.py +++ b/apps/api/src/services/telegram_gateway.py @@ -1951,13 +1951,11 @@ class TelegramGateway: if probable_cause: text += f"└─ 可能根因:{html.escape(probable_cause[:100])}\n" + # 2026-04-16 ogt: 移除 flywheel_diag / flywheel_dashboard (3-part ghost button,無 handler) + # 鐵律: 寧可沒按鈕,不可有死按鈕 (feedback_no_ghost_buttons.md) silence_nonce = self._security.generate_callback_nonce(approval_id, "silence") keyboard = { "inline_keyboard": [ - [ - {"text": "🔄 觸發診斷", "callback_data": f"action:flywheel_diag:{incident_id}"}, - {"text": "📊 查看面板", "callback_data": f"action:flywheel_dashboard:{incident_id}"}, - ], [ {"text": "🔕 靜默 1h", "callback_data": silence_nonce}, ], @@ -2011,6 +2009,9 @@ class TelegramGateway: if defense_action: text += f"\n🛡️ 建議防禦動作\n{html.escape(defense_action[:200])}\n" + # 2026-04-16 ogt: 移除 secops_block_ip / secops_evict (spec=nonce 但用了 2-part格式,無 handler) + # secops 高危操作需 multi-sig,現階段無多簽機制,暫移除等補齊 + # 鐵律: 寧可沒按鈕,不可有死按鈕 (feedback_no_ghost_buttons.md) isolate_nonce = self._security.generate_callback_nonce(approval_id, "secops_isolate") auth_nonce = self._security.generate_callback_nonce(approval_id, "secops_authorize") @@ -2018,10 +2019,6 @@ class TelegramGateway: "inline_keyboard": [ [ {"text": "🚫 隔離資源", "callback_data": isolate_nonce}, - {"text": "⛔ 封鎖來源 IP", "callback_data": f"secops_block_ip:{incident_id}"}, - ], - [ - {"text": "🔄 強制驅逐 Pod", "callback_data": f"secops_evict:{incident_id}"}, {"text": "✅ 確認授權操作", "callback_data": auth_nonce}, ], ] @@ -2068,14 +2065,9 @@ class TelegramGateway: if loss_rate: text += f"└─ 損失速率:{html.escape(loss_rate)}\n" - keyboard = { - "inline_keyboard": [ - [ - {"text": "⏸️ 暫停 1h", "callback_data": f"action:pause_1h:{incident_id}"}, - {"text": "❌ 忽略", "callback_data": f"action:ignore:{incident_id}"}, - ], - ] - } + # 2026-04-16 ogt: 移除 pause_1h / ignore (3-part ghost button,無 handler) + # 鐵律: 寧可沒按鈕,不可有死按鈕 (feedback_no_ghost_buttons.md) + keyboard = {"inline_keyboard": []} target_chat = group_chat_id or settings.OPENCLAW_TG_CHAT_ID return await self._send_request( @@ -2125,17 +2117,9 @@ class TelegramGateway: if current_impact: text += f"└─ 目前影響:{html.escape(current_impact[:100])}\n" - keyboard = { - "inline_keyboard": [ - [ - {"text": "📄 產生 Postmortem 草稿", "callback_data": f"action:postmortem:{incident_id}"}, - ], - [ - {"text": "✅ 確認已接手處理", "callback_data": f"action:escalation_ack:{incident_id}"}, - {"text": "📖 DR 手冊", "callback_data": f"action:dr_manual:{incident_id}"}, - ], - ] - } + # 2026-04-16 ogt: 移除 postmortem / escalation_ack / dr_manual (3-part ghost button,無 handler) + # 鐵律: 寧可沒按鈕,不可有死按鈕 (feedback_no_ghost_buttons.md) + keyboard = {"inline_keyboard": []} results = [] # 發個人 DM