From 9e800ce0236e4d13947d32bb7adebe31ea6123dd Mon Sep 17 00:00:00 2001 From: QiuSW <105186638@qq.com> Date: Thu, 3 Sep 2026 16:54:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E5=8C=BA=E5=88=86=E8=A7=84?= =?UTF-8?q?=E6=A0=BC=E5=85=A5=E5=8F=A3=E7=82=B9=E5=87=BB=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E4=B8=8D=E5=94=AF=E4=B8=80=20(#209)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解析阶段已收敛到唯一语义候选,点击阶段的歧义来自控件树对该目标的 重复匹配。原文案沿用「候选不唯一」,与同串中 specEntryCandidates=1 的证据自相矛盾,不利于事后排查,改为「点击目标不唯一」。 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01NTDbDcwbDw1TSAcE6wfh2F --- .../goauto/agent/automation/PurchaseRehearsalExecutor.kt | 5 ++++- .../cn/ilapage/goauto/agent/PurchaseRehearsalExecutorTest.kt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/java/cn/ilapage/goauto/agent/automation/PurchaseRehearsalExecutor.kt b/android/app/src/main/java/cn/ilapage/goauto/agent/automation/PurchaseRehearsalExecutor.kt index e408a8f..1f3fdfc 100644 --- a/android/app/src/main/java/cn/ilapage/goauto/agent/automation/PurchaseRehearsalExecutor.kt +++ b/android/app/src/main/java/cn/ilapage/goauto/agent/automation/PurchaseRehearsalExecutor.kt @@ -289,9 +289,12 @@ class PurchaseRehearsalExecutor( } val click = driver.clickFreshDetailed(target) when (click.result) { + // The parser already narrowed to a single semantic candidate; the + // ambiguity here comes from the live tree matching that target more + // than once at click time, so the wording must not claim otherwise. FreshActionResult.AMBIGUOUS -> return failure( SPEC_ENTRY_TARGET_AMBIGUOUS, - "规格入口候选不唯一 [${specEntryEvidence(screen, candidates.size)}]", + "规格入口点击目标不唯一 [${specEntryEvidence(screen, candidates.size)}]", ) FreshActionResult.SUCCESS -> Unit else -> return failure(SPEC_ENTRY_CLICK_FAILED, click.reason.specEntrySubreason()) diff --git a/android/app/src/test/java/cn/ilapage/goauto/agent/PurchaseRehearsalExecutorTest.kt b/android/app/src/test/java/cn/ilapage/goauto/agent/PurchaseRehearsalExecutorTest.kt index 5af1d33..8db029c 100644 --- a/android/app/src/test/java/cn/ilapage/goauto/agent/PurchaseRehearsalExecutorTest.kt +++ b/android/app/src/test/java/cn/ilapage/goauto/agent/PurchaseRehearsalExecutorTest.kt @@ -623,7 +623,7 @@ class PurchaseRehearsalExecutorTest { assertEquals("PURCHASE_SPEC_ENTRY_TARGET_AMBIGUOUS", ambiguous.errorCode) assertEquals( - "规格入口候选不唯一 [specEntryCandidates=1;explicit=1;nested=0;bottomPurchase=0;panelAlreadyOpen=false;reviewPage=false;pageEvidence=true]", + "规格入口点击目标不唯一 [specEntryCandidates=1;explicit=1;nested=0;bottomPurchase=0;panelAlreadyOpen=false;reviewPage=false;pageEvidence=true]", ambiguous.message, ) }