Limrun Android: `fill` inserts at the cursor instead of replacing the field's text
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 62/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- android, typescript
- Área
- mobile
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 4.9k
- Forks
- 328
- Merge medio
- 12 h 18 min
- PR fusionados (30 d)
- 538
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de callstack/agent-device
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
callstack/agent-device#3353 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
callstack/agent-device#1869 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
callstack/agent-device#3392 ·
Los mantenedores suelen responder en 1 día
-
settings permission --app writes a display name as the bundle id instead of resolving itPosiblemente ocupada @thymikee la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 22/100
callstack/agent-device#3384 ·
Los mantenedores suelen responder en 1 día
-
iOS: a canceled request releases the session lock while its runner command still runs on the devicePosiblemente ocupada @thymikee la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
callstack/agent-device#3383 ·
Los mantenedores suelen responder en 1 día
Todos los issues de callstack/agent-device
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
cameri/nostream#811 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug p3 triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
bug javascript P2-medium python release:v3.1
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
adrirubio/claude-deck#546 ·
Los mantenedores suelen responder en 1 día
-
area: desktop area: website priority: P2 type: feature
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
appandflow/stim#3411 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
rjsf-team/react-jsonschema-form#5485 ·
Los mantenedores suelen responder en 2 días