From 10fae6ea340bad8f17202c1cbfc050cb35eff87a Mon Sep 17 00:00:00 2001 From: ciregenz Date: Wed, 12 Aug 2026 22:35:47 -0700 Subject: [PATCH] arena: fastpath respects instruction order -- skipping ahead was an instant loss CompWoB's simple-pair autopsy: with "Ok" ambiguous, the fastpath clicked the SECOND quoted target first, and order-enforcing pages fail terminally on that. It now acts only on the first unsatisfied quoted target and otherwise defers to the model -- sequence is part of the task, structurally respected. Lands in v23's queued sweep. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01WsbS5x2rYsMDxP2kW3qqmQ --- e2e/browser-v3/arena/llm_policy.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/e2e/browser-v3/arena/llm_policy.py b/e2e/browser-v3/arena/llm_policy.py index baed6910..618899a6 100644 --- a/e2e/browser-v3/arena/llm_policy.py +++ b/e2e/browser-v3/arena/llm_policy.py @@ -302,12 +302,17 @@ class OpenSwarmLlmPolicy(LlmPolicy): from policies import quoted targets = [t for t in quoted(goal) if t and t not in self.fastpath_used] - for want in targets: - hits = [i for i, bid in self.index_to_bid.items()] - matches = [i for i in hits if self.row_name(i).lower() == want.lower()] - if len(matches) == 1 and not re_.search(r"enter|type|fill|password|text", goal.lower()): - self.fastpath_used.add(want) - return f"click({matches[0]})" + if not targets: + return "" + # ORDER IS PART OF THE TASK: composed goals ("click Ok, then the link") enforce sequence, + # and skipping to a later quoted target because the first is ambiguous clicked things out + # of order -- an instant, unrecoverable loss (measured on ordered pairs). The fastpath may + # only act on the FIRST unsatisfied target; anything else falls through to the model. + want = targets[0] + matches = [i for i in self.index_to_bid if self.row_name(i).lower() == want.lower()] + if len(matches) == 1 and not re_.search(r"enter|type|fill|password|text", goal.lower()): + self.fastpath_used.add(want) + return f"click({matches[0]})" return "" row_names: dict[int, str] = field(default_factory=dict)