From 1fce2ceb032063bf1ccb26f4b1a8ab1a11a6d35d Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 8 Sep 2026 17:23:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(gate):=20=E9=99=8D=E7=BA=A7=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E5=AE=8C=E5=A4=87=E6=80=A7=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E8=B5=B0=E4=BB=A3=E7=A0=81=E8=A1=A8=E2=80=94=E2=80=94LLM/?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E6=8A=80=E8=83=BD=E5=B1=82=E6=8C=89=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E8=87=AA=E8=BA=ABi2i=E5=A5=91=E7=BA=A6=E8=AF=AF?= =?UTF-8?q?=E5=88=A4,=E5=AE=9E=E6=B5=8B=E6=8B=A6=E6=88=AA=E5=90=88?= =?UTF-8?q?=E6=B3=95=E6=96=87=E7=94=9F=E5=9B=BE=E4=BB=BB=E5=8A=A1(2026-09-?= =?UTF-8?q?08)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/platform_model_tools.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pipeline_service/platform_model_tools.py b/pipeline_service/platform_model_tools.py index 9e34fb4..07ed718 100644 --- a/pipeline_service/platform_model_tools.py +++ b/pipeline_service/platform_model_tools.py @@ -383,10 +383,16 @@ async def tool_invoke_model(params, org_id, user_id=""): cap2, desc = await _resolve_capability(model, org_id) cap = cap or cap2 # 能力降级门禁换算:i2i/r2v 模型无媒体输入时按 t2i/t2v 契约校验 - cap = _degrade_gate_cap(cap, biz) - gap = await judge_completeness(model, cap, task, biz, - description=desc, org_id=org_id or "0", - user_id=user_id or "") + cap_gate = _degrade_gate_cap(cap, biz) + if cap_gate != (cap or "").strip().lower(): + # 降级执行:契约是确定性规则,直接代码表判定——LLM/模型技能层会按 + # 模型自身能力(i2i 要源图)误判,实测 2026-09-08 拦截了合法文生图任务 + gap = _check_completeness_code(cap_gate, task, biz) + else: + gap = await judge_completeness(model, cap_gate, task, biz, + description=desc, org_id=org_id or "0", + user_id=user_id or "") + cap = cap_gate if gap: logger.info("invoke_model 完备性门禁拦截(%s): %s", cap or "?", gap[:80]) return "QUESTION: " + gap