From b7c2b691bbad41c85eb6e288e5f4e2421d886415 Mon Sep 17 00:00:00 2001 From: OG T Date: Fri, 17 Apr 2026 11:48:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(p2-backlog):=20=E4=BF=AE=E5=BE=A9=20suggest?= =?UTF-8?q?ed=5Faction=E3=80=8C=E5=BE=85=E5=88=86=E6=9E=90=E3=80=8D?= =?UTF-8?q?=E2=80=94=20action=20=E7=A9=BA=E6=99=82=20fallback=20=E5=88=B0?= =?UTF-8?q?=20description?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因:_push_decision_to_telegram() 的 suggested_action 只有兩條路: - action 有值 → 顯示 action[:120] - action 空 → 顯示「待分析」 但 _package_to_proposal_data() 已從 hypothesis 組出 description (含「根因:...(信心 X%);方案:...」),此時 action="" 卻還是顯示「待分析」 導致 SRE 在 Telegram 卡片看不到 AI 的診斷結論。 修復:action 空時,優先用 description[:120] 作為 suggested_action (description 已包含根因摘要,比「待分析」有意義) fallback chain: action → description → "待分析" 2026-04-17 ogt + Claude Sonnet 4.6 Co-Authored-By: Claude Sonnet 4.6 --- apps/api/src/services/decision_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/services/decision_manager.py b/apps/api/src/services/decision_manager.py index 5fb4811a..5209ec44 100644 --- a/apps/api/src/services/decision_manager.py +++ b/apps/api/src/services/decision_manager.py @@ -354,7 +354,7 @@ async def _push_decision_to_telegram( risk_level=risk_level, resource_name=target[:50], root_cause=reasoning[:300] if reasoning else description[:300], - suggested_action=action[:120] if action else "待分析", + suggested_action=action[:120] if action else (description[:120] if description else "待分析"), estimated_downtime="5-15 min", primary_responsibility="INFRA", confidence=confidence,