feat: 通知发送层切换到群机器人 webhook, 排版精简
- wecom.py 重写: HTTP POST webhook(替代 aibot WebSocket 按需连接), 接口 send_markdown/send_text 不变, Secret Block wecom-webhook 存 URL - webhook markdown 支持标题/引用/font 三色, 报告改为 '## 标题 + 单行结论 + 引用详情' 紧凑排版, 结论行用 info/warning 色 - alert_failure 改标题式排版; device_check 结论用 font 色, 去掉负载行 - 移除 wecom-aibot-sdk 依赖与 wecom_capture_chatid.py(镜像下次构建生效, 无需立即重建)
This commit is contained in:
@@ -102,14 +102,11 @@ def wecom_alert_failure(event: dict | str | None = None) -> dict:
|
||||
ended = detail.get("end_time") or detail.get("expected_start_time")
|
||||
occurred = occurred or ended
|
||||
|
||||
lines = [
|
||||
f"🔴 **流程失败** {flow_name or resource_name or '未知'}",
|
||||
]
|
||||
if run_name and run_name != flow_name:
|
||||
lines.append(f"> Run:{run_name}")
|
||||
lines = [f"## 🔴 流程失败:{flow_name or resource_name or '未知'}"]
|
||||
if run_name:
|
||||
lines.append(f"> Run「{run_name}」 · {event_name.split('.')[-1]} · {_fmt_ts(occurred)}")
|
||||
if state_msg:
|
||||
lines.append(f"> 错误:{state_msg[:150].replace(chr(10), ' ')}")
|
||||
lines.append(f"> {event_name} · {_fmt_ts(occurred)}")
|
||||
if run_id:
|
||||
lines.append(f"> [查看详情]({UI_BASE}/runs/flow-run/{run_id})")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user