callstack / callstack/agent-device

Maestro inputText types whole string at once; debounced inputs only fire once (real Maestro types per-keystroke)

Abierto
#2,159 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug needs-triage
Lenguaje dominante
TypeScript
Estrellas
4.6k
Forks
299
Merge medio
10 h 42 min
PR fusionados (30 d)
493

Descripción

## Summary

Maestro `inputText` in agent-device injects the whole string at once instead of typing it per-keystroke, so a debounced `onChange` only fires once instead of once per character. Real Maestro types each key individually with pacing, which is what makes debounced-input testing work.

## The difference

| | Real Maestro | agent-device `--maestro` |
| --- | --- | --- |
| `inputText` | injects each character/keyevent individually | sends the whole string in one shot |
| Debounced field | `onChange` fires per character | `onChange` fires once at the end |
| Debounce testing | works | not representative |

## Why this happens in agent-device

The Maestro runtime maps `inputText` to the `type` command with no `delay-ms`:

1. `packages/maestro/.../runtime-port-commands.ts` — `executeTextCommand` calls `operations.inputText({ text })`.
2. The daemon adapter projects it to `{ command: 'type', positionals: [text] }` — no delay flag.
3. `src/daemon/type-text-runtime.ts:78` — `delayMs = context.delayMs ?? 0` → **0**.
4. `packages/platform-android/.../text-input.ts` `typeAndroid` with `delayMs === 0`:
- via the bundled test IME: sends the **entire line as one batch broadcast** (`chunks = [whole text]`);
- via the adb shell fallback: chunks at 8 chars with **no delay between chunks**.

So the whole string lands effectively instantly. The per-char pacing machinery already exists — when `delayMs > 0`, `typeAndroid` switches to `chunkSize: 1` with a sleep between characters (`text-input.ts:57-60`) — but no delay ever flows in from the Maestro runtime.

Also worth noting: Maestro's `inputText` grammar only accepts `text` + `label` (there is no per-command delay knob), so the Maestro runtime currently has **no way to request paced typing at all**.

## Proposed direction (for discussion)

Make `--maestro` `inputText` debounce-testable like real Maestro. Options:

1. **Default the Maestro `inputText` path to per-char pacing** (chunk size 1 + small inter-keystroke delay) to match real Maestro semantics, instead of delay 0.
2. **Expose a pacing knob** in the Maestro grammar (`inputText: { text, delayMs }` or similar) so users can choose instant vs. per-keystroke.

Prefer whichever the maintainers feel best preserves Maestro fidelity as the default while keeping an escape hatch for fast fills.

## Environment

- `agent-device` Maestro compatibility backend (`replay *.yaml --maestro`)
- Android (test IME batch broadcast path and adb-shell fallback behave the same)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en packages/maestro/.../runtime-port-commands.ts y sigue executeTextCommand a través de src/daemon/type-text-runtime.ts y packages/platform-android/.../text-input.ts. Revisa las rutas existentes de delayMs y chunking, y determina después si la cadencia predeterminada o un grammar knob encaja mejor con Maestro. Se considera terminado cuando la entrada con debounce recibe eventos por cada pulsación de tecla, conservando al mismo tiempo el comportamiento acordado de fast-fill.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
android, typescript
Área
mobile, testing
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
52/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.