From 1dc55caf7f3c13034864a5d478b269238c7ccd81 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 5 Sep 2026 23:11:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(platform):=20=E8=A3=B8=E5=9F=9F=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E6=8F=90=E5=88=B0=E5=9B=9E=E5=A1=AB=E6=89=93=E6=A0=87?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E2=80=94=E2=80=94=E9=98=B2=E8=A3=B8=E5=9F=9F?= =?UTF-8?q?=E8=A2=AB=E6=89=93=E6=88=90=E5=8D=8F=E8=AE=AE=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E7=AB=AF=E7=82=B9(=E8=87=AA=E6=9F=A5=E5=8F=91=E7=8E=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_platform/platform_ability.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pipeline_platform/platform_ability.py b/pipeline_platform/platform_ability.py index f126a28..72245a2 100644 --- a/pipeline_platform/platform_ability.py +++ b/pipeline_platform/platform_ability.py @@ -523,6 +523,17 @@ async def _h_apply_llm_config(sor, params, ctx): bu = (ep.get("base_url") or "").rstrip("/") if not bu: continue + # 裸域退化拦截(新增与回填打标两条路径都要拦,2026-09-05 e2e 实测: + # 提取 LLM 偶发把 base_url 提成裸域,回填打标会让裸域变「协议匹配」 + # 端点被运行时选中 → 拼出 https://host/services/... → 404) + pu = _urlparse(bu) + if not pu.path.strip("/"): + same_host = any(_urlparse((e.get("base_url") or "")).netloc == pu.netloc + and _urlparse((e.get("base_url") or "")).path.strip("/") + for e in merged) + if same_host: + skipped_eps.append("%s(裸域退化:同 host 已有带路径端点)" % bu) + continue # 同 base_url 已存在:只补协议标签(旧端点无 protocol 时回填) hit = None for e in merged: @@ -533,14 +544,6 @@ async def _h_apply_llm_config(sor, params, ctx): if protocol and not hit.get("protocol"): hit["protocol"] = protocol continue - # 裸域退化拦截:同 host 已有带路径端点 → 裸域跳过 - pu = _urlparse(bu) - if not pu.path.strip("/"): - same_host = any(_urlparse((e.get("base_url") or "")).netloc == pu.netloc - for e in merged) - if same_host: - skipped_eps.append("%s(裸域退化:同 host 已有带路径端点)" % bu) - continue merged.append({"base_url": bu, "region": ep.get("region") or "domestic", "timeout": int(_f(ep.get("timeout"), 60)), "protocol": protocol})