fix(webhooks): primary_responsibility 已是 str 不需 .value

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-03-24 22:16:45 +08:00
parent 09d4e2a373
commit 10adce21ad

View File

@@ -1194,11 +1194,11 @@ async def alertmanager_webhook(
if analysis_result:
# analysis_result 是 OpenClawDecision Pydantic 模型
risk_level = analysis_result.risk_level.value # e.g., "low", "medium", "critical"
risk_level = analysis_result.risk_level.value # enum → "low", "medium", "critical"
action = f"{analysis_result.action_title} | {analysis_result.kubectl_command}"
root_cause = analysis_result.description or message
estimated_downtime = analysis_result.blast_radius.estimated_downtime if analysis_result.blast_radius else "~30s"
primary_responsibility = analysis_result.primary_responsibility.value if hasattr(analysis_result, 'primary_responsibility') and analysis_result.primary_responsibility else "COLLAB"
primary_responsibility = analysis_result.primary_responsibility or "COLLAB" # 已是 str
confidence = analysis_result.confidence
# 建立 ApprovalRecord