You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
find <q> get text / get attrs still take the first of several matches (follow-up to #1625) #4685
#1625 made mutating find reject ambiguous matches and noted: "the read-only engine path (get text/get attrs) keeps first-match semantics — reads don't mutate, so it is flagged rather than changed here." This issue is that follow-up.
The first-match read returns a value without any warning, while get on the same tree refuses. Observed on 0.21.39, on an iOS 27.2 simulator with two rows labelled "dup":
$ agent-device get text 'label="dup"' --session c39
Error (AMBIGUOUS_MATCH): Selector matched 2 elements: label="dup". Not dispatched. …
$ agent-device find "dup" get text --session c39
dup # exit 0, no warning
With rows "Speakers (4)" and "Nov 10 · 4 speakers", find "speakers" get text returns Speakers (4) and exits 0. An agent that reads a value through find cannot tell that it read one of several elements.
In resolution-policy.ts, find's read-only actions use readAny (first-match, "presence is the question"). That fits exists and wait. get text and get attrs read a value, though, and get attrs is fail-closed ("must never guess") when it runs as get. --first and --last are documented as "pick the first/last match when ambiguous", which reads as an explicit opt-in.
Activity
fix(find): reject ambiguous find get text and get attrs