fix(telegram): route direct sends through gateway
All checks were successful
Code Review / ai-code-review (push) Successful in 13s
CD Pipeline / tests (push) Successful in 1m10s
CD Pipeline / build-and-deploy (push) Successful in 3m29s
CD Pipeline / post-deploy-checks (push) Successful in 1m20s

This commit is contained in:
Your Name
2026-05-07 00:33:27 +08:00
parent 7b98f71393
commit ecc65be6e1
5 changed files with 28 additions and 28 deletions

View File

@@ -4399,6 +4399,7 @@ HTTP:
- 沒有正式 `run_id` 的 legacy 發送使用穩定 soft run id`awoooi:legacy-telegram:{chat_id}:{provider_message_id}` 的 UUIDv5。
- legacy 訊息先映射成有限分類:`approval_request``final``error`,供 AwoooP Run / Timeline 後續彙整。
- 鏡像採 fail-openDB / RLS / schema 或 Channel Hub 失敗時只寫 `telegram_outbound_mirror_failed`,不得影響 Telegram 原本送達。
- 成本告警、審批執行結果、自愈 rollback 提案三條 direct Bot API 發送改為走 `TelegramGateway._send_request()`,發送目標與內容不變,但會進 outbound mirror。
### 驗證

View File

@@ -39,6 +39,7 @@ Telegram 不應是完整執行日誌,也不應承載所有 AI 推理細節。T
- `append_incident_update()` 對同一 incident 的相同狀態做 5 分鐘 Redis 去重。
- `append_incident_update()` 對相同的「AI 自動修復失敗 / AI 診斷工具失敗」摘要增加 10 分鐘跨 incident 去重;每個 incident 仍會移除原卡危險按鈕,但 Telegram 不再重複 reply 同一個失敗摘要。
- `TelegramGateway._send_request()` 對成功送出的 legacy `sendMessage` 增加 AwoooP `awooop_outbound_message` 鏡像。鏡像失敗只記錄 `telegram_outbound_mirror_failed`,不能影響 Telegram 正常送達。
- 成本告警、審批執行結果、自愈 rollback 提案已由 direct Bot API 改走 `TelegramGateway._send_request()`,避免繞過 outbound mirror。
- 既有 `詳情 / 重診 / 歷史` 按鈕保留,讓 Telegram 保持輕量,細節回到控制台。
## 後續建議