From 9a4e3e87b803f3d1fc1a758226e150b83b722cd9 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 6 Sep 2026 17:15:53 +0800 Subject: [PATCH] =?UTF-8?q?feat(platform):=20=E8=AE=B0=E8=B4=A6verdict?= =?UTF-8?q?=E5=AF=B9=E9=BD=90NULL=E8=AF=AD=E4=B9=89+=E6=A8=A1=E6=9D=BFmeth?= =?UTF-8?q?od=E7=8B=AC=E7=AB=8B=E5=88=97=E5=86=99=E5=85=A5(2026-09-06?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=9A=E5=A4=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - check_model_accounting: created必为SUCCEEDED真待记账;NULL行报充值对账/调用未成功(不计费),消灭21条失败行冒充待记账的误报 - 提交模板创建写method=POST独立列;查询/下载模板method入列,GET时request_template不再塞{method} - 技能model-auto-config同步status统一枚举+NULL语义+method列(随core仓c27b6af) --- pipeline_platform/platform_ability.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pipeline_platform/platform_ability.py b/pipeline_platform/platform_ability.py index bef389f..c5dc4ff 100644 --- a/pipeline_platform/platform_ability.py +++ b/pipeline_platform/platform_ability.py @@ -738,6 +738,8 @@ async def _h_apply_llm_config(sor, params, ctx): "id": pid, "name": "%s-%s-自动配置" % (protocol, cap), "protocol": protocol, "capability": cap, "path": tpl["path"], + # method 独立列(2026-09-06 用户定夺):提交类模板恒 POST + "method": "POST", "headers": json.dumps(tpl["headers"], ensure_ascii=False), "request_template": tpl["req"], "response_template": tpl["resp"], "param_schema": json.dumps(tpl["param_schema"], ensure_ascii=False), @@ -1529,11 +1531,11 @@ async def _ensure_step_profile(sor, protocol, cap, vmid, step, spec): await sor.sqlExe("COMMIT", {}) # 旧骨架弃用——继续往下重建(不 return) headers = _headers_from_spec(spec) + # method 独立列(2026-09-06 用户定夺):不再塞 request_template JSON if method == "GET": - req = json.dumps({"method": method}, ensure_ascii=False) + req = "" else: - req = json.dumps({"method": method, - "data": {"task_id": "{task_id}"}}, ensure_ascii=False) + req = json.dumps({"data": {"task_id": "{task_id}"}}, ensure_ascii=False) # 查询步骤的响应解析在运行时由提交模板的 response_template 接管 # (inference._async_inference 轮询后直接用提交模板渲染),这里存档即可 resp = json.dumps({ @@ -1543,7 +1545,7 @@ async def _ensure_step_profile(sor, protocol, cap, vmid, step, spec): pid = getID() await sor.C("llm_api_profile", { "id": pid, "name": shared_name, "protocol": protocol, "capability": cap, - "path": path, + "path": path, "method": method, "headers": json.dumps(headers, ensure_ascii=False), "request_template": req, "response_template": resp, "param_schema": "", "status": "active"}) @@ -1870,17 +1872,18 @@ async def _h_check_model_accounting(sor, params, ctx): "模型未映射产品→产品管理导入产线模型;" "定价无匹配档位→核对usages维度值与定价YAML是否一致") elif st == "created": - # m0011 设计:accounting_status 只对 status='ok' 行有意义—— - # failed 调用行/recharge 充值行挂 created 是被出账循环天然排除(不计费), - # 不是「待记账」(2026-09-06 实测:助手把 21 条 failed 行误报成待记账) + # 2026-09-06 用户定夺:只有 status='SUCCEEDED' 的行才写 accounting_status, + # 非 SUCCEEDED 行为 NULL(不再挂 created 冒充待记账)—— + # 走到这里必然是 SUCCEEDED 成功调用的真待记账行 + item["verdict"] = "待记账(出账循环60秒一轮,稍后复查;持续不变查记账worker进程)" + elif not st: + # accounting_status=NULL:无记账意义(调用失败行/充值对账行) call_st = row.get("status", "") if call_st == "recharge": - item["verdict"] = "充值对账流水(非计费用量,不参与出账)" - elif call_st != "ok": - item["verdict"] = "调用失败行(不计费,出账循环天然排除)" - item["reason"] = (row.get("note") or "")[:200] + item["verdict"] = "充值对账流水(非计费用量,accounting_status=NULL)" else: - item["verdict"] = "待记账(出账循环60秒一轮,稍后复查;持续不变查记账worker进程)" + item["verdict"] = "调用未成功行(status=%s,不计费,accounting_status=NULL)" % call_st + item["reason"] = (row.get("note") or "")[:200] elif st == "accounted": # 独立复算:用 usages 因子过定价引擎,对比 charge item["verdict"] = "已记账"