Skip to content

fix(snapshot): preserve visible controls within tree budgets on all platforms - #145

Merged
iFurySt merged 5 commits into
mainfrom
codex/visible-tree-budget
Nov 2, 2026
Merged

iFurySt merged 5 commits into
mainfrom
codex/visible-tree-budget

Conversation

@iFurySt

@iFurySt iFurySt commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Large lists can exhaust a snapshot's node budget before later dialog buttons are visited. This change prioritizes visible controls and ordinary UI regions across macOS AX, Windows UIA and Linux AT-SPI, then renders the selected graph in its original order with valid action indexes and ancestor paths.

The default 1200-node limit stays unchanged. Candidate discovery is separately bounded, duplicate references and cycles cannot bypass it, and truncated snapshots carry an explicit notice. macOS respects AXVisibleChildren; Linux supplements SHOWING with viewport geometry; Windows batches UIA properties per snapshot to avoid the 30-second timeout found by the real WPF test.

Validation:

  • macOS: signed native MCP with a real 2000-file NSOpenPanel at 1200/40 nodes, actual indexed Cancel, all 12 sheet/panel scenarios, and 423 Swift tests (9 skipped, zero failures). The old runtime loses Cancel at 40 nodes. The existing 300-control AppKit output matches main and live actions work.
  • Linux: real GTK/AT-SPI with 2000 rows, both budgets, footer clicks and newly visible last row after scrolling; hidden-detail, action read-back, JS and selective-observation regressions pass. Old main loses the footer at the default 1200-node budget. Python 39 tests and Linux Go tests pass.
  • Windows: real WPF/UIA/native MCP with 2000 items, both budgets, footer clicks and newly visible last item; existing observation, scroll, DPI and physical-input regressions pass. The sample snapshots took 9.3s/5.4s within the unchanged timeout. Production PowerShell traversal and Go tests pass.
  • Node: 54 tests pass; repository documentation and action-pinning checks pass.

Reproducible commands and limits: docs/tree-budget.md. A slow provider's individual API call is still outside the candidate-count bound; extremely small budgets cannot guarantee every control.

Final-head Windows CI passed. Its first attempt timed out while starting the pre-existing WPF fixture, before native MCP was launched; the unchanged commit passed on retry.

@iFurySt
iFurySt marked this pull request as ready for review November 2, 2026 14:21
@iFurySt

iFurySt commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

LGTM. Thanks!

@iFurySt
iFurySt merged commit bf7c12d into main Nov 2, 2026
1 of 2 checks passed
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