From d5550d8904568c90d2a3cbadf906a35b32db6c58 Mon Sep 17 00:00:00 2001 From: 16337 <1633794139@qq.com> Date: Mon, 9 Mar 2026 12:52:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20VLM=E9=99=8D=E7=BA=A7=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=86=8D=E8=87=AA=E5=8A=A8=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=B8=BA=E8=AF=AF=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VLM调用失败(skipped=true)和VLM判定误报是两种情况, 降级跳过时保留告警原始状态,让人工处理。 Co-Authored-By: Claude Opus 4.6 --- app/services/notify_dispatch.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/services/notify_dispatch.py b/app/services/notify_dispatch.py index 9972307..31117e9 100644 --- a/app/services/notify_dispatch.py +++ b/app/services/notify_dispatch.py @@ -57,12 +57,17 @@ async def process_alarm_notification(alarm_data: Dict): # 写入 alarm_llm_analysis 表(复用已有表) _save_vlm_result(alarm_id, vlm_result) - # VLM 判定为误报 → 更新告警状态,不通知 - if not vlm_result.get("confirmed", True): + # VLM 明确判定为误报(非降级跳过)→ 更新告警状态,不通知 + if not vlm_result.get("confirmed", True) and not vlm_result.get("skipped"): _mark_false_alarm(alarm_id) logger.info(f"VLM 判定误报,跳过通知: {alarm_id}") return + # VLM 跳过(降级)且 confirmed=False → 不改告警状态,仅跳过通知 + if not vlm_result.get("confirmed", True) and vlm_result.get("skipped"): + logger.info(f"VLM 降级跳过,不推送但保留告警状态: {alarm_id}") + return + # ========== 2. 查表获取通知人员 ========== description = vlm_result.get("description", "") area_name, persons = _get_notify_persons(device_id, alarm_level)