callstack / callstack/agent-device
Maestro inputText types whole string at once; debounced inputs only fire once (real Maestro types per-keystroke)
- 主要言語
- TypeScript
- スター
- 4.7k
- フォーク
- 303
- 平均マージ
- 10時間 42分
- マージ済み PR(30日)
- 493
説明
## 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)
コントリビューションガイド
調査の方向性
packages/maestro/.../runtime-port-commands.ts から開始し、src/daemon/type-text-runtime.ts と packages/platform-android/.../text-input.ts を通じて executeTextCommand をたどります。既存の delayMs と chunking の経路を確認し、そのうえでデフォルトのペーシングと grammar knob のどちらが Maestro に適しているかを判断します。完了の条件は、デバウンスされた入力がキー入力ごとのイベントを受け取り、合意済みの fast-fill の動作を維持することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- android, typescript
- 領域
- mobile, testing
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100