From 58ea001e7d202946a872e9aec07d7c8357303209 Mon Sep 17 00:00:00 2001 From: yu <191972707@qq.com> Date: Tue, 3 Nov 2026 15:07:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=B8=E5=AF=B9=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BA=92=E6=8D=A2=E6=9C=AA=E5=91=BD=E4=B8=AD=E6=97=B6=E7=BB=99?= =?UTF-8?q?=E4=BA=92=E4=B8=8D=E5=8C=85=E5=90=AB=E7=BB=BC=E5=90=88=E8=AF=8A?= =?UTF-8?q?=E6=96=AD,=20=E4=B8=8D=E5=86=8D=E8=AF=AF=E5=AF=BC=E4=B8=BA?= =?UTF-8?q?=E5=B0=BA=E5=AF=B8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/capabilities/remaining-core.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/capabilities/remaining-core.ts b/src/main/capabilities/remaining-core.ts index 023cc45..c739423 100644 --- a/src/main/capabilities/remaining-core.ts +++ b/src/main/capabilities/remaining-core.ts @@ -226,8 +226,13 @@ register("Image_RelativePosition", async (ctx, node, args) => { } } if (!hit) { - if (firstError) throw firstError; - throw new RuntimeError("not_found", "查找目标未出现在被搜索图像中", { nodeId: node.id, componentId: node.componentId, recommendation: "「查找目标」应是被搜索图里出现的小图案(按钮/图标/文字块);两张图互不包含时无法匹配" }); + // 互换也没命中:两张图内容互不包含(或真的不存在),给出综合诊断而不是误导性的尺寸错误 + throw new RuntimeError("not_found", "查找目标未出现在被搜索图像中(已自动尝试反向查找仍未命中,两张图内容互不包含)", { + nodeId: node.id, + componentId: node.componentId, + detail: firstError instanceof Error ? firstError.message : String(firstError ?? ""), + recommendation: "「被搜索图像」应是较大的底图(如整屏/整窗截图),「查找目标」应是底图中实际出现的小图案(按钮/图标/文字块)的截图;两张完全无关的图无法匹配" + }); } return hit; });