Skip to content

fix: axTree() window and budget reporting say what actually happened - #16

Merged
woladi merged 2 commits into
mainfrom
feat/window-match
Aug 24, 2026
Merged

woladi merged 2 commits into
mainfrom
feat/window-match

Conversation

@woladi

@woladi woladi commented Aug 24, 2026

Copy link
Copy Markdown
Owner

Found while wiring uiSnapshot into the MCP server.

axTree({ app: 'Safari', window: 1 }) on an app with one window did not fail — it fell through to walking the application element instead. That returns a larger, different tree and no window frame, presented as though it had answered the question:

axTree window=0: 224 nodes, window [-1,33,1728,1017]
axTree window=1: 230 nodes, window undefined     ← silently a different question

Now it fails with the count the app actually exposes, and says so separately when an app exposes no accessibility windows at all (minimised or hidden).

10 tests over axTree, 105 total.

🤖 Generated with Claude Code

woladi and others added 2 commits August 24, 2026 19:16
Asking for window 1 on an app with one window fell through to walking the
application element: a larger, different tree with no window frame,
returned as though it answered the question. It now fails with the count
the app actually exposes, and distinguishes the case where there are no
accessibility windows at all (minimised or hidden).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
maxElements caps the walk, and pruning runs afterwards, so a result could
show elements: 315 next to maxElements: 400 and capped: true — three
numbers that read as a contradiction. budget.walked is what the cap
applies to; elements is what came back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@woladi woladi changed the title fix: axTree() rejects an out-of-range window index fix: axTree() window and budget reporting say what actually happened Aug 24, 2026
@woladi
woladi merged commit 34d1a2b into main Aug 24, 2026
1 check failed
@woladi
woladi deleted the feat/window-match branch August 24, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant