callstack / callstack/agent-device

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

Offen
#2,159 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug needs-triage
Vorherrschende Sprache
TypeScript
Sterne
4.6k
Forks
299
Ø Merge
10 Std. 23 Min.
Gemergte PRs (30 T.)
535

Beschreibung

## 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)

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in packages/maestro/.../runtime-port-commands.ts und verfolge executeTextCommand durch src/daemon/type-text-runtime.ts und packages/platform-android/.../text-input.ts. Überprüfe die vorhandenen Pfade für delayMs und Chunking und ermittle anschließend, ob die standardmäßige Taktung oder ein Grammar-Knob besser zu Maestro passt. Erledigt ist die Aufgabe, wenn eine entprellte Eingabe Ereignisse für jeden Tastendruck empfängt und dabei das vereinbarte Verhalten für schnelles Ausfüllen erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
android, typescript
Bereich
mobile, testing
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
52/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.