fix: stabilize Maestro post-gesture snapshots#681
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4392fb09f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ): boolean { | ||
| if (flags?.postGestureStabilization === true) return true; | ||
| if (action === 'swipe' || action === 'scroll') return true; | ||
| return action === 'gesture' && positionals[0] === 'swipe'; |
There was a problem hiding this comment.
Mark rewritten gesture swipes for stabilization
When a Maestro directional swipe (or a direct CLI replay) invokes gesture swipe left, request-generic-dispatch.ts rewrites it to platformCommand === 'swipe-preset' and strips the swipe subcommand before calling markPostGestureStabilization, so this new action === 'gesture' branch is not reached in the real dispatcher path. Because the Maestro directional path intentionally leaves postGestureStabilization unset, those swipes still skip stabilization and can capture the first post-swipe snapshot mid-transition.
Useful? React with 👍 / 👎.
| ], | ||
| flags: { | ||
| ...params.baseReq.flags, | ||
| postGestureStabilization: true, |
There was a problem hiding this comment.
Strip internal stabilization flag before recording generic swipes
When Maestro percentage swipes add this internal flag and invoke the generic swipe command, request-generic-dispatch.ts records recordedFlags from req.flags unchanged, unlike the touch-interaction path that calls stripInternalInteractionOutcomeFlags. This means recorded/replayed public actions for these swipes persist postGestureStabilization: true, exposing an internal daemon control that the commit otherwise tries to strip from replay actions.
Useful? React with 👍 / 👎.
306a1f7 to
5719192
Compare
5719192 to
90be4d3
Compare
aa9221d to
2808792
Compare
Summary
Stabilize Maestro replay snapshots after mutating gestures and harden iOS runner lifecycle behavior seen in external QA.
gesture swipe ...commands participate in the same stabilization so Maestro directional swipes do not sample mid-transition.gesture swipethrough the same provider-native touch injection / bundled touch-helper path as pinch, rotate, and transform, withadb input swipeas a fallback.AgentDeviceRunneris not left foregrounded.snapshot/diffwhen no target app is tracked, returning anopen-first error instead of exposing the runner app tree.gesture swipe left|rightin-page presets to the mid-content lane. The old lower lane could land in blank pager space on Android material top tabs, causing swipes to report success while the page stayed put.Validation
pnpm exec vitest run src/platforms/android/__tests__/multitouch-helper.test.tspnpm exec vitest run src/platforms/android/__tests__/multitouch-helper.test.ts src/core/__tests__/dispatch-interactions.test.ts src/__tests__/runtime-interactions.test.ts src/compat/maestro/__tests__/runtime-interactions.test.tspnpm testpnpm check:quickpnpm exec vitest run src/compat/maestro/__tests__/runtime-interactions.test.ts src/compat/maestro/__tests__/runtime-targets.test.ts src/__tests__/runtime-interactions.test.ts src/core/__tests__/dispatch-interactions.test.tspnpm exec vitest run src/platforms/ios/__tests__/open-ios.test.ts src/platforms/ios/__tests__/session-open.test.ts src/platforms/ios/__tests__/runner-client.test.ts src/daemon/__tests__/client-timeout.test.ts src/commands/__tests__/snapshot-command.test.ts src/compat/maestro/__tests__/runtime-interactions.test.tspnpm check:fallowpnpm buildnpm pack --pack-destination /private/tmp/agent-device-packbottom-tabs.yml,material-top-tabs.yml,image-crop.ymlbottom-tabs.yml,material-top-tabs.yml,image-crop.ymlmaestro-ios,maestro-android