Repository navigation
Description
Written by an AI agent on behalf of @Elehiggle.
Problem
On the iPhone Duo simulator, gestures fail without dispatching when the AX tree is deep enough that XCTest rejects the app root. On the test app's heavy feed, press 'id="heavy-post-0-like"' --json returns (trimmed):
{
"code": "COMMAND_FAILED",
"message": "Neither the target app nor the system surface resolved a window, so no display could be named.",
"hint": "The capture follows the display that owns a window, so this is a runtime that is answering no window for any process; runner.log names the window frame and the query answer it refused.",
"details": { "runnerErrorCode": "APP_SCREEN_WINDOW_UNRESOLVED", "dispatched": "no" }
}get text still reads the screen. In the runner log, XCTest rejects the app's tree right before the lit-panel walk reports an empty window list:
AGENT_DEVICE_RUNNER_COMMAND_ACCEPTED command=tap
AGENT_DEVICE_RUNNER_AX_SNAPSHOT_ISSUE_SUPPRESSED count=4 description=Failed to resolve query: Error kAXErrorIllegalArgument getting snapshot for element <AXUIElementRef …> {pid=<app>} {uid=[ID:1 hash:0x0]}
AGENT_DEVICE_RUNNER_LIT_PANEL_WINDOW lit=1(466x678) windows=0 outcome=no resolved application window frame=(inf,inf 0x0)
AGENT_DEVICE_RUNNER_COMMAND_COMPLETED command=tap ok=0
Before the feed opened, the same walk found windows=2 on the Settings screen.
From reading main (not traced at runtime): RunnerCopyWindowList returns nil when the query throws or returns no list. Here XCTest records an issue and returns an empty list instead, so RunnerResolveLitPanelWindow treats the rejected read as a missing window. Since #4122, a throwing window read returns APP_SCREEN_UNRESOLVED; one XCTest rejects without throwing still fails as a missing window. elementSearchRoots already rejects a walk that recorded issues; bookRequestLitPanelSurface does not check. The error message also mentions a system-surface fallback that the gesture path never tries; only captureObservedScreen does.
Seen
- agent-device (npm): 0.21.41 (
lateston 2026-11-23) and 0.21.42-nightly.20261123.242; both fail. Main at 4b945ab has the same code (read, not run). - Node 26.13.1, Xcode 27.2 (27B52), macOS 27.2.1, arm64
- iPhone Duo simulator, iOS 27.2 (24B91016s), one lit panel: fails
- iPhone 18 Pro simulator, iOS 27.2 (24B8117): passes. The Duo runs a different iOS build, but gestures there also take the lit-panel branch, which the iPhone never enters.
- First seen in a React Native (Expo) app.
Minimal repro
Test app from main at 45cf4c2. A Release build embeds the JavaScript, so it runs without Metro:
pnpm test-app:install
cd examples/test-app
pnpm exec expo run:ios --configuration Release --no-bundler --device <duo-udid>
agent-device open com.callstack.agentdevicelab --platform ios --udid <duo-udid> --session duo
agent-device press 'label="Settings"' --session duo
agent-device scroll down --until 'id="open-heavy-feed"' --session duo
agent-device press 'id="open-heavy-feed"' --session duo
agent-device press 'id="heavy-post-0-like"' --session duo --json
agent-device get text 'id="heavy-feed-liked-count"' --session duoOn the Duo, the like press fails as above and the count stays Liked posts: 0. scroll down and longpress 'id="heavy-post-0"' fail the same way. On iPhone 18 Pro, the count reads Liked posts: 1.
Required behavior
When XCTest rejects the app's tree during the lit-panel walk, the command fails with APP_SCREEN_UNRESOLVED, not APP_SCREEN_WINDOW_UNRESOLVED. The current APP_SCREEN_UNRESOLVED message and hint ("The resolved app window did not report the display it is shown on", "Retry the capture") do not fit either, so this case needs its own message and hint saying the app tree is unreadable.
Open question
#3870 kept the window requirement for multi-screen devices on purpose. Could RunnerProbeApplicationFillsScreen from the iPad route prove per panel that the app fills the lit panel, so a lit-panel counterpart of that route lets the tap land?
Done when
With the heavy feed open on the Duo, the like press fails with APP_SCREEN_UNRESOLVED and a message and hint about the unreadable app tree. A runner unit test for a window read that records an issue fails without the change.
Activity
[-]iOS Duo: on a deep AX tree, press/scroll/longpress refuse as APP_SCREEN_WINDOW_UNRESOLVED[/-][+]iOS Duo: press/scroll/longpress fail with APP_SCREEN_WINDOW_UNRESOLVED on a deep AX tree[/+]thymikee commentedon Nov 24, 2026
The runner currently treats the empty window list as a missing window even when XCTest recorded a query rejection. The regression should distinguish that rejected read from a genuine empty list and preserve the no-dispatch result. The heavy-feed repro and runner log are enough to start.
fix(ios): refuse a lit-panel window walk that recorded an XCTest issue (