Skip to content

feat: add WaitFor condition waits#255

Merged
Jeomon merged 1 commit into
CursorTouch:mainfrom
LaplaceYoung:feature/wait-for-conditions
May 21, 2026
Merged

feat: add WaitFor condition waits#255
Jeomon merged 1 commit into
CursorTouch:mainfrom
LaplaceYoung:feature/wait-for-conditions

Conversation

@LaplaceYoung
Copy link
Copy Markdown

Related issue: Addresses #87.

Summary

  • Add WaitFor for condition-based UI readiness waits inside one tool call.
  • Support text, active window, element, enabled element, and focused element conditions with aliases.
  • Reuse Desktop.get_state with bounded polling and DOM opt-in for browser text.
  • Document the tool in the README tool list.

Duplicate check

Open PR search for WaitFor / condition waits found the unrelated window-targeted screenshot PR #233.

Testing

  • uv run ruff check src/windows_mcp/tools/input.py tests/test_wait_for_tool.py README.md
  • uv run python -m pytest tests/test_wait_for_tool.py tests/test_multi_tools.py -> 9 passed
  • uv run python -m pytest -> 304 passed, 6 existing tests/test_tree_views.py failures; existing flash overlay access violation stack observed

Agents can now wait for common UI readiness signals inside one tool call, using the existing desktop state capture path and a bounded polling loop.

Constraint: Issue CursorTouch#87 discussion prioritizes condition waits with a small polling fallback.
Rejected: Event-driven WatchDog wakeups in this PR | polling contract keeps the contribution narrow.
Confidence: high
Scope-risk: narrow
Directive: Preserve WaitFor inputs and timeout semantics when adding WatchDog wakeups.
Tested: uv run ruff check src/windows_mcp/tools/input.py tests/test_wait_for_tool.py README.md; uv run python -m pytest tests/test_wait_for_tool.py tests/test_multi_tools.py; uv run python -m pytest (304 passed, 6 existing tests/test_tree_views.py failures observed)
Not-tested: Repository-wide green pytest run; current run reports the existing tests/test_tree_views.py failures.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@Jeomon Jeomon merged commit c9a2aff into CursorTouch:main May 21, 2026
@Jeomon
Copy link
Copy Markdown
Member

Jeomon commented May 21, 2026

Thanks

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.

2 participants