You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Windows backend (crates/tui/plugins/computer-use/src/backends/win32.mjs) reports {action_sent: true} even when the underlying action never ran. Three independent defects:
No in-process type definition.create() only loads the User32 P/Invoke type in the bootstrap PowerShell process. Every action runs in a freshpowershell.exe spawned by ps(), so [User32]::mouse_event / SendInput / GetCursorPos are undefined there and the call fails — but nobody checks.
left_mouse_down precedence bug.target ? A : "" + B evaluates "\u201c" + B on the no-target branch, so a targeted call only emits SetCursorPos and silently drops mouse_event(LEFTDOWN).
Impact
A parked/crashed agent, or any Windows session, believes input (clicks, drags, typing, key combos) was delivered when it was not. The model proceeds on false confirmations — a silent, high-impact correctness failure.
Fix (in progress)
Make create() accept an injectable runner ({ exec }) so the backend is testable without powershell.exe.
Prepend the User32 type definition (USER32_DEF) to every User32-backed script so each action is self-contained.
withUser32 now throws an ExecError on a nonzero exit instead of reporting success.
Rewrite left_mouse_down so a targeted call both moves and presses.
cursor_position routes through withUser32 so it loads the type in-process and fails truthfully.
Regression tests in tests/win32.test.mjs (mocked runner): type defined in-process, failure path rejects, targeted left_mouse_down moves+presses.
Root cause
The Windows backend (
crates/tui/plugins/computer-use/src/backends/win32.mjs) reports{action_sent: true}even when the underlying action never ran. Three independent defects:create()only loads theUser32P/Invoke type in the bootstrap PowerShell process. Every action runs in a freshpowershell.exespawned byps(), so[User32]::mouse_event/SendInput/GetCursorPosare undefined there and the call fails — but nobody checks.withUser32never inspects the exit code. It justreturn ps(script, opts), so a nonzero exit is ignored and every User32 action returns success unconditionally (see Windows computer-use reports input success after PowerShell failure #5896).left_mouse_downprecedence bug.target ? A : "" + Bevaluates"\u201c" + Bon the no-target branch, so a targeted call only emitsSetCursorPosand silently dropsmouse_event(LEFTDOWN).Impact
A parked/crashed agent, or any Windows session, believes input (clicks, drags, typing, key combos) was delivered when it was not. The model proceeds on false confirmations — a silent, high-impact correctness failure.
Fix (in progress)
create()accept an injectable runner ({ exec }) so the backend is testable withoutpowershell.exe.User32type definition (USER32_DEF) to every User32-backed script so each action is self-contained.withUser32now throws anExecErroron a nonzero exit instead of reporting success.left_mouse_downso a targeted call both moves and presses.cursor_positionroutes throughwithUser32so it loads the type in-process and fails truthfully.tests/win32.test.mjs(mocked runner): type defined in-process, failure path rejects, targetedleft_mouse_downmoves+presses.Relates to #5896.