Repository navigation
Enable accessibility tree (ax) command on iOS emulator sessions - #10007
AmethystLiang merged 2 commits into
Conversation
Fetch the accessibility tree from serve-sim's /ax endpoint, which requires an active session but provides the same UI snapshot capability as Android's uiautomator output. Derive the endpoint from the stream URL when not explicitly provided by the helper, and route through the bridge to pass session context to the backend.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe emulator accessibility-tree command now supports iOS serve-sim AX snapshots in addition to Android uiautomator output. Session parsing derives AX endpoints from MJPEG stream URLs, while the bridge resolves and routes endpoints to the iOS backend. A new SSE fetcher handles streamed trees, settling, timeouts, and errors. Runtime command routing, backend contracts, tests, CLI metadata, and skill documentation were updated accordingly. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Tests verify accessibility tree routes through EmulatorBridge, Android backend ignores iOS-specific ax URLs, and ax endpoints are derived from serve-sim stream URLs.
) (#10029) * Revert "Enable accessibility tree (`ax`) command on iOS emulator sessions (#10007)" This reverts commit 43ae014. * fix(emulator): expose iOS accessibility tree * fix(emulator): support device-only iOS AX * fix(emulator): normalize iOS ax to 0..1 and heal missing axUrl serve-sim's helper /ax reports element frames in absolute pixels, but tap/gesture take normalized 0..1 coords. Normalize the raw AX node tree into a compact nested shape whose frames are 0..1 over the device screen (first root's frame), mirroring serve-sim's own normalizeAxTree, so agents can feed ax output straight back into input commands. Also heal sessions that were registered without an axUrl: #9924 only derived /ax at parse time, so already-active sessions had no endpoint. The bridge now derives it from the session's mjpeg stream URL, guarded to the /stream.mjpeg suffix so a non-mjpeg URL never fabricates a bogus /ax. * docs(emulator): mark ax working on iOS with correct raw-AX-tree shape Both skill guides and the CLI summary described iOS ax as unsupported (or, via the reverted #10007, as a normalized "screen + elements" shape that never matched the endpoint). ax works on both backends: Android via uiautomator, iOS via the serve-sim helper. Document the real iOS output — a raw AX node tree (labels, roles, nested children) with frames normalized to 0..1 — and regenerate the bundled skill guides. * chore(skills): regenerate skill bundle manifests CI verify failed because generated skill artifacts were stale after version/skill revision bumps. * fix(emulator): read ax from explicit device without active session Fall back to udid-keyed session lookup when a worktree has no active emulator, allowing `--device` targeting to work the same way for ax as it does for tap/type. Also clarify in docs that AX frames are normalized 0..1 with top-left origin, and show how to tap an element at its frame center (x+width/2, y+height/2). * fix(emulator): cap iOS AX tree at 500 nodes Unbounded accessibility trees can flood agent output. Enforce a 500-node limit (matching serve-sim's snapshot cap) and mark truncated parents so consumers know the tree was cut. --------- Co-authored-by: 5Hyeons <[email protected]>
…blyai#10007) (stablyai#10029) * Revert "Enable accessibility tree (`ax`) command on iOS emulator sessions (stablyai#10007)" This reverts commit 43ae014. * fix(emulator): expose iOS accessibility tree * fix(emulator): support device-only iOS AX * fix(emulator): normalize iOS ax to 0..1 and heal missing axUrl serve-sim's helper /ax reports element frames in absolute pixels, but tap/gesture take normalized 0..1 coords. Normalize the raw AX node tree into a compact nested shape whose frames are 0..1 over the device screen (first root's frame), mirroring serve-sim's own normalizeAxTree, so agents can feed ax output straight back into input commands. Also heal sessions that were registered without an axUrl: stablyai#9924 only derived /ax at parse time, so already-active sessions had no endpoint. The bridge now derives it from the session's mjpeg stream URL, guarded to the /stream.mjpeg suffix so a non-mjpeg URL never fabricates a bogus /ax. * docs(emulator): mark ax working on iOS with correct raw-AX-tree shape Both skill guides and the CLI summary described iOS ax as unsupported (or, via the reverted stablyai#10007, as a normalized "screen + elements" shape that never matched the endpoint). ax works on both backends: Android via uiautomator, iOS via the serve-sim helper. Document the real iOS output — a raw AX node tree (labels, roles, nested children) with frames normalized to 0..1 — and regenerate the bundled skill guides. * chore(skills): regenerate skill bundle manifests CI verify failed because generated skill artifacts were stale after version/skill revision bumps. * fix(emulator): read ax from explicit device without active session Fall back to udid-keyed session lookup when a worktree has no active emulator, allowing `--device` targeting to work the same way for ax as it does for tap/type. Also clarify in docs that AX frames are normalized 0..1 with top-left origin, and show how to tap an element at its frame center (x+width/2, y+height/2). * fix(emulator): cap iOS AX tree at 500 nodes Unbounded accessibility trees can flood agent output. Enforce a 500-node limit (matching serve-sim's snapshot cap) and mark truncated parents so consumers know the tree was cut. --------- Co-authored-by: 5Hyeons <[email protected]>
…ablyai#10007) * Enable accessibility tree (`ax`) command on iOS emulator sessions Fetch the accessibility tree from serve-sim's /ax endpoint, which requires an active session but provides the same UI snapshot capability as Android's uiautomator output. Derive the endpoint from the stream URL when not explicitly provided by the helper, and route through the bridge to pass session context to the backend. * Add ax command routing and backend integration tests Tests verify accessibility tree routes through EmulatorBridge, Android backend ignores iOS-specific ax URLs, and ax endpoints are derived from serve-sim stream URLs.
…blyai#10007) (stablyai#10029) * Revert "Enable accessibility tree (`ax`) command on iOS emulator sessions (stablyai#10007)" This reverts commit 9011129. * fix(emulator): expose iOS accessibility tree * fix(emulator): support device-only iOS AX * fix(emulator): normalize iOS ax to 0..1 and heal missing axUrl serve-sim's helper /ax reports element frames in absolute pixels, but tap/gesture take normalized 0..1 coords. Normalize the raw AX node tree into a compact nested shape whose frames are 0..1 over the device screen (first root's frame), mirroring serve-sim's own normalizeAxTree, so agents can feed ax output straight back into input commands. Also heal sessions that were registered without an axUrl: stablyai#9924 only derived /ax at parse time, so already-active sessions had no endpoint. The bridge now derives it from the session's mjpeg stream URL, guarded to the /stream.mjpeg suffix so a non-mjpeg URL never fabricates a bogus /ax. * docs(emulator): mark ax working on iOS with correct raw-AX-tree shape Both skill guides and the CLI summary described iOS ax as unsupported (or, via the reverted stablyai#10007, as a normalized "screen + elements" shape that never matched the endpoint). ax works on both backends: Android via uiautomator, iOS via the serve-sim helper. Document the real iOS output — a raw AX node tree (labels, roles, nested children) with frames normalized to 0..1 — and regenerate the bundled skill guides. * chore(skills): regenerate skill bundle manifests CI verify failed because generated skill artifacts were stale after version/skill revision bumps. * fix(emulator): read ax from explicit device without active session Fall back to udid-keyed session lookup when a worktree has no active emulator, allowing `--device` targeting to work the same way for ax as it does for tap/type. Also clarify in docs that AX frames are normalized 0..1 with top-left origin, and show how to tap an element at its frame center (x+width/2, y+height/2). * fix(emulator): cap iOS AX tree at 500 nodes Unbounded accessibility trees can flood agent output. Enforce a 500-node limit (matching serve-sim's snapshot cap) and mark truncated parents so consumers know the tree was cut. --------- Co-authored-by: 5Hyeons <[email protected]>
Summary
Enable the
orca emulator axcommand for iOS simulator sessions by implementing support for serve-sim's/axHTTP endpoint. Previously, theaxcapability was marked as Android-only; this change allows agents and users to query the accessibility tree on iOS via the active session's serve-sim helper.Changes
accessibilityTreeas supported on iOS (previously Android-only).EmulatorSessionInfoto track the/axendpoint URL, either explicitly provided by serve-sim or derived from the stream endpoint./axendpoint via a newfetchServeSimAccessibilityTreefunction.axrequests through the bridge'saccessibilityTree()method to pass the session endpoint URL to the backend; derive/axfrom/stream.mjpegURLs when explicitaxUrlis not available.axworks on both iOS and Android with backend-specific output (serve-sim AX snapshot on iOS, uiautomator tree on Android).Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— new test suites added forfetchServeSimAccessibilityTree, bridge routing, and iOS backend ax support.pnpm buildAI Review Report
Reviewed implementation for correctness:
emulator_no_active, HTTP errors →emulator_error, unparseable events →emulator_helper_failed./axendpoint from/stream.mjpegURLs ensures compatibility with sessions registered without explicitaxUrl.Security Audit
emulator_helper_failed.Notes
axcommand now returns serve-sim's native accessibility snapshot format on iOS (screen dimensions + element tree) vs. Android's uiautomator dump format.emulator_no_activeif missing).adb uiautomator; iOS backend uses serve-sim's/axendpoint.