Skip to content

docs(cua-driver): Windows behavior notes for the v0.2.9 fix chain + install.ps1 PS 5.1 workaround - #1627

Merged
f-trycua merged 2 commits into
mainfrom
docs/cua-driver-rs-windows-v0.2.9-fix-chain
May 21, 2026
Merged

docs(cua-driver): Windows behavior notes for the v0.2.9 fix chain + install.ps1 PS 5.1 workaround#1627
f-trycua merged 2 commits into
mainfrom
docs/cua-driver-rs-windows-v0.2.9-fix-chain

Conversation

@f-trycua

@f-trycua f-trycua commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes the missing docs gap for the four cua-driver-rs Windows fixes that shipped in v0.2.9 (#1619 shared fixtures, #1620 Chromium flag auto-inject, #1621 UIA Invoke whitelist, #1623 SendInput on Chromium), and documents the install.ps1 PowerShell 5.1 parse bug (#1626) with a manual-zip workaround.

mcp-tools.mdx

  • New top-level section ## Windows behavior notes at the end of the reference, gathering the three cross-cutting changes:
    • launch_app Chromium flag list + the 10 detected browser executables
    • click(x, y) control-type whitelist + why canvases / Panes / Customs fall through to PostMessage / SendInput
    • SendInput on Chromium with brief foreground swap + cursor jump, the UIAccess requirement, and the cua-driver-uia.exe proxy default
    • hotkey's SendInput-routed delivery + matching UIAccess constraint
  • Inline cross-references from click, launch_app, and hotkey pointing to the Windows behavior section so callers reading any of those tool entries see the platform-specific notes.

installation.mdx

Test plan

  • Both pages render in fumadocs (Callout already imported in installation.mdx; the new section in mcp-tools.mdx uses standard markdown only)
  • Visual check on the deployed Vercel preview that the cross-references resolve ([Windows behavior notes](#windows-behavior-notes) anchors land on the new section)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added Windows PowerShell 5.1 installation workaround with manual zip installation instructions
    • Added Windows-specific behavior documentation for click, hotkey, and launch_app MCP tools

Review Change Stack

…nstall.ps1 PS 5.1 workaround

Tonight's three cua-driver-rs Windows fixes (#1620 Chromium anti-throttling
flag auto-inject in `launch_app`, #1621 control-type whitelist for the
`click(x, y)` UIA Invoke pre-check, #1623 SendInput routing for Chromium
coord clicks) shipped in v0.2.9 without docs updates. This PR closes that
gap and documents the install.ps1 PS 5.1 parse bug as a known issue.

## mcp-tools.mdx

- New top-level section `## Windows behavior notes` at the end of the
  reference, gathering the three cross-cutting changes:
  - `launch_app` Chromium flag list + the 10 detected browser executables
  - `click(x, y)` control-type whitelist (Button / MenuItem / Hyperlink /
    TabItem / ListItem / CheckBox / RadioButton / SplitButton / TreeItem) +
    why canvases / Panes / Customs fall through
  - SendInput on Chromium with brief foreground swap + cursor jump, the
    UIAccess requirement, and the `cua-driver-uia.exe` proxy default
  - `hotkey`'s SendInput-routed delivery + matching UIAccess constraint
- Inline cross-references from `click`, `launch_app`, and `hotkey`
  pointing to the Windows behavior section so callers reading any of
  those tool entries see the platform-specific notes.

## installation.mdx

- Callout under the Windows install one-liner documenting #1626 (PS 5.1
  parse error on `install.ps1`) with the manual-zip workaround verbatim
  from the issue, scoped to PS 5.1 only (PS 7+ parses fine).

Closes the standing /docs update obligation for #1619, #1620, #1621, #1623.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 21, 2026 2:11pm

Request Review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 53885931-bbeb-4b72-86c2-8a1d60d715fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR documents two Windows-specific issues: it adds a PowerShell 5.1 installation workaround to the getting-started guide, and it expands the MCP tool reference with comprehensive Windows behavior notes describing UIA integration, SendInput dispatch mechanics, and Chromium anti-throttling behavior for the click, hotkey, and launch_app tools.

Changes

Windows documentation updates

Layer / File(s) Summary
PowerShell 5.1 installation workaround
docs/content/docs/cua-driver/guide/getting-started/installation.mdx
Added a known-issue callout documenting install.ps1 parsing failure in PowerShell 5.1 and provided a manual zip-install procedure with arch selection and User PATH configuration, noting PowerShell 7+ is unaffected.
Windows behavior notes for MCP tools
docs/content/docs/cua-driver/reference/mcp-tools.mdx
Added inline Windows-specific notes to click, hotkey, and launch_app tools describing UIA pre-checks, SendInput dispatch, and anti-throttling flags. Introduced a new "Windows behavior notes" section detailing control-type whitelists, canvas fallback, cursor/focus side effects, UIAccess requirements, and dispatch semantics.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • trycua/cua#1576: Updates Windows installation experience by making install.ps1 idempotently auto-add the bin directory to the user PATH with a -NoPathUpdate opt-out, while this PR documents a manual zip-install workaround for PowerShell 5.1 parsing failures.
  • trycua/cua#1608: Adds UIA root-walk and click fallback for CoreWindow apps, while this PR documents broader Windows behavior notes for click, hotkey, and UIA integration in the MCP tool reference.
  • trycua/cua#1604: Introduces the cua-driver-uia.exe worker with UIAccess privilege, which is documented and recommended in this PR's new Windows behavior notes section.

Poem

🐰 A doc trail through Windows so fine,
PowerShell 5 and UIA align,
With SendInput dispatch and anti-throttle flags,
Our MCP tools now dance without lags!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main changes: documentation for Windows behavior notes in v0.2.9 and a PowerShell 5.1 install workaround, matching both modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/cua-driver-rs-windows-v0.2.9-fix-chain

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/content/docs/cua-driver/reference/mcp-tools.mdx (1)

1148-1191: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Move this content to the generator source, then regenerate mcp-tools.mdx.

Line 1148 onward is being added directly to a file marked auto-generated, and CI already fails with doc drift for this file. This will keep breaking Check Documentation Sync (or be overwritten later). Please add these Windows notes in the docs generator/source-of-truth path and re-generate the MDX output before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/cua-driver/reference/mcp-tools.mdx` around lines 1148 -
1191, The auto-generated file contains a manually added "## Windows behavior
notes" section (starting at "Chromium anti-throttling flags auto-injected" and
covering the launch_app/click/hotkey notes) that must be moved into the
documentation generator's source-of-truth and the MDX re-generated; remove this
manual addition from mcp-tools.mdx, add the same content into the docs generator
input (the generator page for the mcp-tools reference / the template that
produces the launch_app/click/hotkey docs), then run the docs generation task to
regenerate mcp-tools.mdx so CI passes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/docs/cua-driver/guide/getting-started/installation.mdx`:
- Line 84: The current PowerShell snippet unconditionally prepends $dest to the
User Path using SetEnvironmentVariable and
GetEnvironmentVariable('Path','User'), which causes duplicate entries on
repeated runs; update the snippet to first read the current User Path into a
variable, check whether $dest is already present (e.g., via -notmatch or
splitting on ';' and using -contains), and only call
[Environment]::SetEnvironmentVariable('Path', "$dest;" + $currentPath, 'User')
when $dest is not already in the path to make the operation idempotent.

---

Outside diff comments:
In `@docs/content/docs/cua-driver/reference/mcp-tools.mdx`:
- Around line 1148-1191: The auto-generated file contains a manually added "##
Windows behavior notes" section (starting at "Chromium anti-throttling flags
auto-injected" and covering the launch_app/click/hotkey notes) that must be
moved into the documentation generator's source-of-truth and the MDX
re-generated; remove this manual addition from mcp-tools.mdx, add the same
content into the docs generator input (the generator page for the mcp-tools
reference / the template that produces the launch_app/click/hotkey docs), then
run the docs generation task to regenerate mcp-tools.mdx so CI passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff7be63e-36cf-42d2-8cb1-1f266a4da5db

📥 Commits

Reviewing files that changed from the base of the PR and between fd8d3e3 and e64209b.

📒 Files selected for processing (2)
  • docs/content/docs/cua-driver/guide/getting-started/installation.mdx
  • docs/content/docs/cua-driver/reference/mcp-tools.mdx

$dest = "$env:LOCALAPPDATA\Programs\trycua\cua-driver-rs\bin"
New-Item -ItemType Directory -Force -Path $dest | Out-Null
Expand-Archive -Force -Path $env:TEMP\cua.zip -DestinationPath $dest
[Environment]::SetEnvironmentVariable('Path', "$dest;" + [Environment]::GetEnvironmentVariable('Path','User'), 'User')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="docs/content/docs/cua-driver/guide/getting-started/installation.mdx"
echo "== File exists? =="
ls -la "$file" || true

echo "== Show lines around 70-100 =="
nl -ba "$file" | sed -n '60,110p'

Repository: trycua/cua

Length of output: 283


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="docs/content/docs/cua-driver/guide/getting-started/installation.mdx"
echo "== File exists? =="
ls -la "$file" || true

echo "== Show lines around 70-100 =="
nl -ba "$file" | sed -n '60,110p'

Repository: trycua/cua

Length of output: 283


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="docs/content/docs/cua-driver/guide/getting-started/installation.mdx"

echo "== Lines 70-100 (with line numbers via awk) =="
awk 'NR>=70 && NR<=100 {printf "%5d  %s\n", NR, $0}' "$file"

Repository: trycua/cua

Length of output: 2734


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "SetEnvironmentVariable\('Path'" docs/content/docs/cua-driver/guide/getting-started/installation.mdx || true
rg -n "idempot|NoPathUpdate|PathUpdate|-NoPathUpdate" docs/content/docs/cua-driver/guide/getting-started/installation.mdx || true

Repository: trycua/cua

Length of output: 1219


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n "\[Environment\]::SetEnvironmentVariable\('Path', \"\\$dest;" docs/content/docs/cua-driver/guide/getting-started/installation.mdx || true
rg -n "manual zip install|cua\.zip|cua\.zip -OutFile|$dest = \"" docs/content/docs/cua-driver/guide/getting-started/installation.mdx || true

Repository: trycua/cua

Length of output: 96


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="docs/content/docs/cua-driver/guide/getting-started/installation.mdx"

rg -n '\$dest;' "$file" || true
rg -n '\[Environment\]::SetEnvironmentVariable\(' "$file" || true
rg -n 'manual zip install|cua\.zip|Expand-Archive' "$file" || true

Repository: trycua/cua

Length of output: 1526


Make the PATH update idempotent in the PS 5.1 workaround.

Line 84 prepends $dest to the User Path unconditionally, so re-running the manual zip workaround can duplicate the entry. Add a guard before SetEnvironmentVariable.

Suggested doc snippet update
-  [Environment]::SetEnvironmentVariable('Path', "$dest;" + [Environment]::GetEnvironmentVariable('Path','User'), 'User')
+  $userPath = [Environment]::GetEnvironmentVariable('Path','User')
+  $parts = @($userPath -split ';' | Where-Object { $_ -ne '' })
+  if ($parts -notcontains $dest) {
+    [Environment]::SetEnvironmentVariable('Path', "$dest;$userPath", 'User')
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[Environment]::SetEnvironmentVariable('Path', "$dest;" + [Environment]::GetEnvironmentVariable('Path','User'), 'User')
$userPath = [Environment]::GetEnvironmentVariable('Path','User')
$parts = @($userPath -split ';' | Where-Object { $_ -ne '' })
if ($parts -notcontains $dest) {
[Environment]::SetEnvironmentVariable('Path', "$dest;$userPath", 'User')
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/content/docs/cua-driver/guide/getting-started/installation.mdx` at line
84, The current PowerShell snippet unconditionally prepends $dest to the User
Path using SetEnvironmentVariable and GetEnvironmentVariable('Path','User'),
which causes duplicate entries on repeated runs; update the snippet to first
read the current User Path into a variable, check whether $dest is already
present (e.g., via -notmatch or splitting on ';' and using -contains), and only
call [Environment]::SetEnvironmentVariable('Path', "$dest;" + $currentPath,
'User') when $dest is not already in the path to make the operation idempotent.

#1627)

Re-running the manual-install workaround duplicated `$dest` in the User
PATH because the snippet unconditionally prepended. Guards with a
`-notcontains` check before `SetEnvironmentVariable` so the entry is
added at most once.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@f-trycua

Copy link
Copy Markdown
Collaborator Author

Addressed in 15d9e19 — added -notcontains $dest guard before SetEnvironmentVariable so the manual-zip workaround is idempotent on re-run.

External link-check failure (hermes/pull/22821 404 in process-model.mdx) is pre-existing and not in any file touched by this PR.

@f-trycua
f-trycua merged commit 1410c30 into main May 21, 2026
5 of 8 checks passed
@f-trycua
f-trycua deleted the docs/cua-driver-rs-windows-v0.2.9-fix-chain branch May 21, 2026 14:12
f-trycua added a commit that referenced this pull request May 21, 2026
… SendInput dispatch (#1629)

The hotkey tool description still claimed "Legacy Win32 targets receive
the combo directly via PostMessage(WM_KEYDOWN/UP)" — but #1614/#1618
changed the dispatch to use SendInput (via the cua-driver-uia worker)
for combos containing modifiers, because PostMessage doesn't update the
OS-wide modifier state and accelerators fail to fire on TranslateAccelerator-
based apps (LibreOffice, FAR, classic Notepad, etc.).

The actual current dispatch (impl_.rs::HotkeyTool::invoke, lines ~1859-1879):

  1. XAML / WinUI / UWP target  → UIA accelerator-key invocation
  2. Legacy Win32 WITH modifiers → SendInput (brief foreground swap, UIAccess required)
  3. Legacy Win32 WITHOUT modifiers → PostMessage WM_KEYDOWN/UP

Description now matches reality across all three branches, including the
UIAccess requirement and the cua-driver-uia worker proxy auto-preference.

Caught during Inkscape stress testing — agents reading the tool docs
would expect PostMessage-only behavior and be surprised by the visible
cursor / foreground change on modifier+key hotkeys, or by the
"SendInput inserted only 0 of 4 events" diagnostic when the daemon
lacks UIAccess.

The mcp-tools.mdx entry for hotkey is auto-generated from this Rust
source (per the AUTO-GENERATED comment at the top of mcp-tools.mdx), so
this fix regenerates the public docs on the next docs build. PR #1627
also has an inline cross-reference from the hotkey section to the
Windows behavior notes; the two land complementary improvements.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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