Skip to content

fix(ios): refuse a lit-panel window walk that recorded an XCTest issue - #5063

Merged
thymikee merged 1 commit into
callstack:mainfrom
imranbarbhuiya:fix/ios-rejected-window-read
Nov 24, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
imranbarbhuiya:fix/ios-rejected-window-read

Conversation

@imranbarbhuiya

@imranbarbhuiya imranbarbhuiya commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #5023.

On a lit-panel request, XCTest answers an app tree it cannot snapshot with an empty window list and a recorded issue, not an exception. The booking read that as an app without windows and refused with APP_SCREEN_WINDOW_UNRESOLVED, whose message names a system-surface fallback that gestures never try.

  • bookRequestLitPanelSurface holds the walk's XCTest issues. A walk that finds no window and records one (a rejected tree, a window gone mid-walk, a hung query) refuses with a new unreadableWindows refusal: APP_SCREEN_UNRESOLVED, dispatched: no, and its own message and hint. Without an issue it stays APP_SCREEN_WINDOW_UNRESOLVED; a walk that books a window keeps it.
  • Held issues are recorded again, so AX-issue muting and the hung-query rule are unchanged.
  • The APP_SCREEN_WINDOW_UNRESOLVED message no longer claims the system surface was asked.

The gesture still does not dispatch: it needs the booked window for its display and frame (#3870).

Before / after

iPhone Duo simulator (iOS 27.2), test app heavy feed, base 63fe1b6fe, head f299f0f55. JSON trimmed to the error fields.

$ agent-device press 'id="heavy-post-0-like"' --json
base: APP_SCREEN_WINDOW_UNRESOLVED, dispatched: no
      "Neither the target app nor the system surface resolved a window, so no display could be named."
head: APP_SCREEN_UNRESOLVED, dispatched: no
      "XCTest recorded an issue while reading the target app's windows on the lit panel, so they could not be read."

runner.log (head, consecutive lines):
AGENT_DEVICE_RUNNER_RECORDED_ISSUE_HELD issue=Failed to resolve query: Error kAXErrorIllegalArgument getting snapshot for element <AXUIElementRef> {pid=11449} {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_AX_SNAPSHOT_ISSUE_SUPPRESSED count=1 description=Failed to resolve query: Error kAXErrorIllegalArgument getting snapshot for element <AXUIElementRef> {pid=11449} {uid=[ID:1 hash:0x0]}
AGENT_DEVICE_RUNNER_LIT_PANEL_WINDOW_UNREAD issues=1

Liked posts: 0 at both. On Settings, head books windows=2 and the press lands.

Validation

  • Head f299f0f55: check:affected --run --head (exactCommit: true) passed format through vitest-related; pnpm gate provider-integration (317 tests), adr-citations, xctest-selection, runner-error-codes and packaged-runner-swift passed.
  • The new runner test passes on the Duo and fails with each of: the base booking code, no issue check, no outcome check, no re-record, .unresolvedScreen in its place, the old message and hint, and a guard that admits only kAX issues.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

On a lit-panel request, XCTest answers an app tree it cannot snapshot with
an empty window list and a recorded issue. The booking read that list as an
app without windows and refused with APP_SCREEN_WINDOW_UNRESOLVED, whose
message names a system-surface fallback that gestures never try.

The booking now holds the walk's issues: a walk that finds no window and
records an issue refuses with APP_SCREEN_UNRESOLVED and a message about the
unread windows, and dispatches nothing. Every held issue is recorded again
as before. The no-window message no longer claims the system surface was
asked.

Closes callstack#5023.
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. At f299f0f, a lit-panel window walk that recorded an XCTest issue is now refused, and the Swift runner changes, the ADR and the TS comment show no problems.

CI is green. Smoke Tests (ios), Repo Guards and Runner Build pass, and the two cancelled Body rules runs are superseded runs of the same workflow. There are no conflicts.

Not verified here: the Swift runner unit tests and the mutation claims, which need an Xcode simulator. The Duo before/after run was not reproduced, and a hung query or a window gone mid-walk was seen only through the test probe, not live. Whether the runner unit-test lane runs in PR CI at this head was not checked either.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 24, 2026
@thymikee
thymikee merged commit 8a29aea into callstack:main Nov 24, 2026
16 of 18 checks passed
@imranbarbhuiya
imranbarbhuiya deleted the fix/ios-rejected-window-read branch November 24, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Duo: press/scroll/longpress fail with APP_SCREEN_WINDOW_UNRESOLVED on a deep AX tree

2 participants