Skip to content

Fix UI searches continuing past their timeout - #254

Merged
sbroenne merged 3 commits into
mainfrom
sbroenne-install-button-timeout
Sep 30, 2026
Merged

sbroenne merged 3 commits into
mainfrom
sbroenne-install-button-timeout

Conversation

@sbroenne

@sbroenne sbroenne commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #253.

  • Use one deadline across ui_find and appear/disappear wait retries and accessibility-tree scans.
  • Do not start a final full scan at or after the deadline; stop between provider operations in matching, modal-dialog lookup, framework detection, element conversion, identity lookup, child enumeration, and fallback passes.
  • Return an explicit timeout when a scan is unfinished rather than claiming absence, uniqueness, or successful disappearance.
  • Preserve last-scan diagnostics and distinguish a missing window/dialog from a missing element, including whitespace-padded dialog scopes.
  • Reuse detected framework information for diagnostics where available.
  • Keep timeoutMs=0 as one node-bounded scan without a time deadline; document that Windows accessibility calls already running can still overrun the budget.

This addresses confirmed timeout-policy problems. It does not establish why the originally reported Install button was missed.

Validation

  • Build succeeds without warnings after merging current main.
  • 959 unit tests pass.
  • 62 targeted Windows integration tests pass, covering deadlines, disappearance, dialog scopes, uniqueness, and node budgets.
  • Added deterministic provider-call and slow-traversal regressions plus real queued-search timeout tests for find and disappearance.
  • Updated the existing disappearance timeout test to distinguish completed observations from interrupted scans, while asserting failure, timeout type, elapsed budget, and absence of success items.
  • Node-budget-only MCP tests explicitly use timeoutMs=0 so they test the 2,000-node limit independently of machine speed.

Full Windows integration validation runs through the pull request workflow.

Stop scans and retries at the shared timeout without claiming partial absence or uniqueness. Preserve timeout diagnostics and missing-dialog details.

Refs #253

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 30, 2026 16:12
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sbroenne
sbroenne deployed to windows-ui-runner September 30, 2026 16:16 — with GitHub Actions Active
@sbroenne
sbroenne enabled auto-merge (squash) September 30, 2026 16:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several auxiliary UIA traversals still make multiple provider calls without deadline checks, allowing searches to continue after timeout.

Review effort: Balanced
Findings: 5 Medium severity

Open (5)
What changed in this PR

Introduces shared deadlines across UI searches, retries, and tree traversal while improving timeout diagnostics and documentation.

Changes:

  • Stops retries and bounded traversal when deadlines expire.
  • Preserves timeout diagnostics and distinguishes unfinished searches.
  • Adds unit and integration coverage for deadline behavior.
File Description
FEATURES.md Documents timeout semantics.
UIAutomationDiagnostics.cs Clarifies timeout configuration.
BoundedSearchTraversal.cs Adds traversal deadline checks.
UIAutomationService.Find.cs Applies shared deadlines and diagnostics.
UIAutomationService.Tree.cs Shares deadlines across wait scans.
UIFindTool.cs Documents find timeout behavior.
UIWaitTool.cs Documents wait timeout behavior.
BoundedSearchTraversalTests.cs Tests traversal interruption.
FindDeadlineTests.cs Tests retry and diagnostic semantics.
UIAutomationAdvancedSearchTests.cs Updates deadline integration expectations.
UIFindToolIntegrationTests.cs Tests queued-search expiration.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Sbroenne.WindowsMcp/Automation/BoundedSearchTraversal.cs
Comment thread src/Sbroenne.WindowsMcp/Automation/UIAutomationService.Find.cs
Comment thread src/Sbroenne.WindowsMcp/Automation/UIAutomationService.Find.cs
Comment thread src/Sbroenne.WindowsMcp/Automation/UIAutomationService.Find.cs Outdated
Comment thread src/Sbroenne.WindowsMcp/Automation/UIAutomationService.Find.cs
@sbroenne
sbroenne deployed to windows-ui-runner September 30, 2026 16:38 — with GitHub Actions Active
Bound modal lookup, matching, framework discovery, child conversion and element identity reads. Preserve normalized dialog diagnostics and isolate node-budget tests from elapsed time.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@sbroenne
sbroenne deployed to windows-ui-runner September 30, 2026 16:41 — with GitHub Actions Active
@sbroenne
sbroenne deployed to windows-ui-runner September 30, 2026 17:09 — with GitHub Actions Active
@sbroenne
sbroenne merged commit 8658351 into main Sep 30, 2026
11 checks passed

This branch was successfully deployed

1 active deployment
windows-ui-runner — a32c50ed Deployed Sep 30, 2026 by sbroenne via Deallocate Windows UI runner #292
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.

UI searches can continue scanning after their timeout

2 participants