πΎ Open Computer Use β Open-Source Alternative to Codex Computer Use
[2026-04-22 12:46] | Task: Add Windows Computer Use Runtime
π€ Execution Context
- Agent ID:
Codex - Base Model:
GPT-5 - Runtime:
Codex CLI
π₯ User Query
Extend the project beyond macOS Accessibility to Windows, avoid coupling to Swift
.app, consider Go-generated.exe, and prioritize functional implementation of the 9 Computer Use tools for background computer use. Use the UTM Windows host over SSH for testing where practical, and leave TODOs if the full scope is too large.
π Changes Overview
Scope: Windows runtime, build scripts, CI, docs
Key Actions:
- [Runtime]: Added
apps/OpenComputerUseWindows, a Go CLI/MCP runtime exposing the same 9 Computer Use tools,call --calls, MCP initialize/tools list, and per-process snapshot cache. - [Bridge]: Embedded a Windows PowerShell UI Automation bridge for app/window discovery, accessibility tree snapshots, screenshots, UIA pattern actions, ValuePattern, ScrollPattern, and Win32 window-message fallback input.
- [Build/CI]: Added
scripts/build-open-computer-use-windows.shfor arm64/amd64.exebuilds and wired Go tests intoscripts/ci.sh. - [Docs]: Updated README, architecture, quality score, and added an active Windows runtime execution plan with the remaining TODOs.
- [Follow-up Fix]: Used Windows Codex App session history to identify
get_app_statefailures afterlist_appssucceeded, then hardened process matching and UIA tree rendering againstArgument types do not match. - [Interactive Validation]: Verified through an interactive Windows scheduled task that
get_app_state -> type_text -> get_app_statewriteshello windows mcpinto Notepad and returns the updated UIA value. - [Background Policy]: Removed the default app-launch fallback and disabled
SetFocusby default so Windows tools do not intentionally steal foreground focus; both behaviors remain available through explicit environment variables. - [Type Text Focus Fix]: Changed
type_textto prefer child-windowEM_SETSEL/EM_REPLACESELmessages and made the UIAValuePattern.SetValuetext fallback opt-in because Notepad can foreground itself from that UIA path. - [Focus Validation]: Re-ran an interactive Windows scheduled task against Notepad;
get_app_state -> type_text -> get_app_statereturned three non-error results, wrote abgmsg-*marker, and left the foreground window title asCodexbefore and after the call.
π§ Design Intent (Why)
Windows should have its own executable boundary instead of inheriting macOS .app and Swift/AppKit assumptions. The first slice keeps the public tool protocol stable and makes the runtime buildable/testable as a .exe; the bridge can be replaced with more native Go UIA internals later without changing MCP or CLI callers.
Windows UI Automation can often operate on background windows through control patterns such as ValuePattern, InvokePattern, and ScrollPattern, but Windows does not provide one universal macOS-AX-equivalent background keyboard/mouse model for every GUI toolkit. The runtime therefore avoids the known foreground-taking paths by default and treats launch, focus, and UIA text fallback as explicit opt-in behavior.
π Files Modified
apps/OpenComputerUseWindows/go.modapps/OpenComputerUseWindows/main.goapps/OpenComputerUseWindows/main_test.goapps/OpenComputerUseWindows/runtime.ps1scripts/build-open-computer-use-windows.shscripts/ci.shREADME.mdREADME.zh-CN.mddocs/ARCHITECTURE.mddocs/QUALITY_SCORE.mddocs/exec-plans/active/20260422-windows-computer-use-runtime.md