Limrun Android: `fill` inserts at the cursor instead of replacing the field's text
Maintainer antworten meist innerhalb von 1 Tag
Ein zugehöriger Pull Request wurde bereits gemerged.
- #3362 von @thymikee — gemerged
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 62/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- android, typescript
- Bereich
- mobile
Rechercherichtung
Start in the Android fill path where agent-device returns after the provider-native provider.text call, since that call skips the adb clear, verify and retry steps (KEYCODE_MOVE_END and KEYCODE_DEL). The Limrun instance client's setText and pressKey calls are the relevant entry points. Done means fill on a field with existing text leaves exactly the new value, and a mismatch is reported rather than passing silently. Reproduce with the Settings search field commands in the issue.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
On a Limrun Android instance, fill does not replace the existing contents of a text field. The new text is inserted wherever the tap leaves the cursor, so filling a field that already has a value produces a concatenation of the old and new text. The help text says fill <target> <text> replaces, and that is what happens on local emulators.
Environment
- agent-device: 0.21.15, and the same code path is present in 0.21.24 (latest at the time of writing)
- Provider: Limrun, Android instance (
agent-device connect limrun --platform android) - Keyboard on the instance:
com.android.inputmethod.latin(the agent-device test IME is not active) - App: the system Settings app (any
EditTextreproduces it)
Steps to reproduce
agent-device connect limrun --platform android --run-id fill-repro --session repro
agent-device open settings --platform android --session repro
agent-device snapshot -i --platform android --session repro # find "Search Settings"
agent-device click @e2 --platform android --session repro # opens the search field
agent-device fill @e7 "[email protected]" --platform android --session repro
agent-device fill @e7 "[email protected]" --platform android --session repro
agent-device snapshot -i --platform android --session repro
Expected
After the second fill, the field contains:
[email protected]
Actual
The second fill taps the field center, which puts the cursor inside the existing value, and inserts the text there:
[email protected][email protected]
Both fill calls exit successfully. A caller that does not re-read the field carries on with the wrong value.
Cause
On Android, fill first checks whether the device provider supplies its own text entry. Limrun does (provider.text → the Limrun instance client's setText({ x, y }, text)), so agent-device returns after that call. It never reaches the Android path that clears the field (KEYCODE_MOVE_END + KEYCODE_DEL), verifies the result and retries, or uses the test IME.
Calling the Limrun Android instance client directly on the same instance shows that setText never replaces:
| Call | Result |
|---|---|
setText({ x, y }, text) (what agent-device sends) |
inserted at the cursor |
setText({ selector: { focused: true } }, text) |
inserted at the cursor |
setText(undefined, text) |
inserted at the cursor |
setText({ selector: { focused: true } }, '') |
rejected: text is required |
So with the provider-native path there is currently no way to clear the field before typing.
Workaround that worked
Selecting all and deleting with hardware key events before setText, through the same Limrun instance client:
await client.pressKey('a', ['ctrl']);
await client.pressKey('del');
await client.setText(undefined, text);
This left the field holding exactly the requested text in 3 of 3 runs. The select and delete took about 350 ms together; setText took about 1 s.
Suggested fix
For a Limrun Android fill, clear the focused field before the provider-native setText (for example with the Ctrl+A / Delete key events above), then run the existing verification so a mismatch is reported instead of passing silently. Alternatively, route Limrun Android fill through the existing adb clear/verify/retry path or the test IME.
Possibly related (not reproduced)
In one run, a fill into a field that had just taken focus from another field lost its first character (jane… arrived as ane…). I could not reproduce it on a single field in 4 attempts, so it is mentioned only in case it shares the cause.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5.2k
- Forks
- 359
- Ø Merge
- 12 Std. 54 Min.
- Gemergte PRs (30 T.)
- 637
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus callstack/agent-device
-
bug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
callstack/agent-device#4018 ·
Maintainer antworten meist innerhalb von 1 Tag
-
A session bound to an Apple device rejects --device=<its own UDID>Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
callstack/agent-device#3945 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Limrun iOS fill reports success but drops non-ASCII textEvtl. vergeben @mvanhorn hat das vor 8 Tagen übernommen. Offenbug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 87/100
callstack/agent-device#3819 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
callstack/agent-device#1869 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Android snapshot helper: a capture cancelled in its first milliseconds stalls the next captureOffenbug ready-for-agent
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 72/100
callstack/agent-device#4030 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in callstack/agent-device
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
marmelab/react-admin#11431 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
db-ux-design-system/core-web#8655 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
epam/statgpt-admin-frontend#305 ·
Maintainer antworten meist innerhalb von 1 Tag