fix(telegram): 修復所有 webhook 路徑缺失 ai_provider → Telegram 顯示「AI 仲裁判定」
Some checks failed
E2E Health Check / e2e-health (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled

根本原因: send_approval_card() 有 ai_provider 參數,但三個 webhook 呼叫端都沒傳:
- signoz_webhook.py: 有 ai_provider 參數但未轉傳給 send_approval_card
- sentry_webhook.py: 有 analysis.analyzed_by 但未傳
- webhooks.py: _push_to_telegram_background 缺少 ai_provider 參數

修復後 Telegram 會顯示「🤖 OpenClaw Nemo 仲裁」而非「🤖 AI 仲裁判定」

2026-04-02 ogt: 三個 webhook 路徑統一修復

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-02 00:51:13 +08:00
parent 5959855a71
commit 077e1cd637
3 changed files with 9 additions and 0 deletions

View File

@@ -447,6 +447,8 @@ async def send_sentry_telegram_alert(
confidence=analysis.confidence if analysis else 0.0,
namespace="sentry",
anomaly_frequency=anomaly_frequency,
# 2026-04-02 ogt: 修復 ai_provider 未傳遞 → Telegram 顯示「AI 仲裁判定」而非具體模型名稱
ai_provider=analysis.analyzed_by if analysis else "",
)
logger.info(

View File

@@ -385,6 +385,8 @@ async def send_signoz_telegram(
confidence=analysis_result.confidence if analysis_result else 0.0,
namespace=labels.get("namespace", "signoz"),
anomaly_frequency=anomaly_frequency,
# 2026-04-02 ogt: 修復 ai_provider 未傳遞 → Telegram 顯示「AI 仲裁判定」而非具體模型名稱
ai_provider=ai_provider if ai_provider != "none" else "",
)
logger.info(

View File

@@ -171,6 +171,8 @@ async def _push_to_telegram_background(
signoz_latency_trend: str = "stable",
signoz_trace_url: str = "",
auto_tuning_command: str = "",
# 2026-04-02 ogt: 修復 ai_provider 未傳遞 → Telegram 顯示「AI 仲裁判定」而非具體模型名稱
ai_provider: str = "",
) -> None:
"""
背景任務: 推送待簽核卡片到 Telegram (v7.0 含 SignOz 整合)
@@ -217,6 +219,7 @@ async def _push_to_telegram_background(
# 2026-03-29 ogt: AI Token/Cost 追蹤
ai_tokens=ai_tokens,
ai_cost=ai_cost,
ai_provider=ai_provider,
)
logger.info(
@@ -772,6 +775,7 @@ async def receive_alert(
# 2026-03-29 ogt: AI Token/Cost 追蹤
ai_tokens=ai_tokens,
ai_cost=ai_cost,
ai_provider=ai_provider,
)
return AlertResponse(
@@ -1142,6 +1146,7 @@ async def alertmanager_webhook(
# 2026-03-29 ogt: AI Token/Cost 追蹤
ai_tokens=ai_tokens,
ai_cost=ai_cost,
ai_provider=ai_provider,
)
return AlertResponse(