Skip to content

Commit b0e19c9

Browse files
authored
perf: improve recording and interaction flows (#563)
* perf: improve recording and interaction flows * feat: add React Native overlay dismiss command * test: cover RedBox overlay dismissal * fix: simplify React Native overlay snapshot hint * fix: address daemon and scroll review feedback * fix: unblock ci after recording polish * chore: refresh fallow health baseline * test: stabilize android provider suites * test: cover rn overlay provider command
1 parent f71371e commit b0e19c9

68 files changed

Lines changed: 3598 additions & 622 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Command-only flags (like `find --first`) that don't flow to the platform layer o
126126
## Hard Rules
127127
- Use process helpers from `src/utils/exec.ts` for TypeScript process execution: `runCmd`, `runCmdStreaming`, `runCmdSync`, `runCmdBackground`, and `runCmdDetached`. Do not import raw `spawn`/`spawnSync` outside `src/utils/exec.ts`; add or extend an exec helper instead. Plain `.mjs` packaging fixtures that cannot import TypeScript helpers should keep child-process usage local and prefer `execFile`/`execFileSync` over spawn.
128128
- Use daemon session flow for interactions (`open` before interactions, `close` after).
129+
- Every manual `agent-device open` must have a matching `agent-device close` before the agent finishes, using the same `--session`, `--platform`, `--udid`, and `--state-dir` flags.
129130
- Use `keyboard dismiss` for iOS keyboard dismissal; it may tap safe native controls such as `Done` but must not fall back to system back navigation.
130131
- Do not remove shared snapshot/session model behavior without full migration.
131132
- Command/device support must come from `src/core/capabilities.ts`.
@@ -158,6 +159,13 @@ Command-only flags (like `find --first`) that don't flow to the platform layer o
158159
- After changing runtime code exercised through `bin/agent-device.mjs` or the daemon, run `pnpm build` and `pnpm clean:daemon` before manual device verification so snapshots use current `dist` output.
159160
- For Android RN/Expo/dev-client apps connected to any local Metro port, `adb reverse tcp:<port> tcp:<port>` is harmless and should be run before opening the app or URL on the emulator/device.
160161

162+
## Manual Device Session Hygiene
163+
- Treat every manually opened `agent-device` session as a resource that must be closed, including exploratory sessions and failed verification attempts.
164+
- For experiments, use a purpose-specific session name and, when practical, an isolated `--state-dir` under `/private/tmp` so stale metadata does not poison the default daemon.
165+
- Keep track of each opened session in the working notes. Before final response, close each one with the same flags used to open it.
166+
- If `close` or a later command is blocked by stale daemon metadata, inspect running processes first with `ps -ax | rg "agent-device|xcodebuild test-without-building"`. Stop only exact stale PIDs that belong to the verification run, then run `pnpm clean:daemon`.
167+
- If cleanup cannot be completed, report the remaining session name, state dir, process IDs, and metadata paths as a blocker.
168+
161169
## Selector System Rules
162170
- Interaction commands (`click`, `fill`, `get`, `is`) and `wait` accept selectors and `@ref`.
163171
- Pipeline: **parse -> resolve -> act -> record selectorChain -> heal on replay**.

0 commit comments

Comments
 (0)