👾 Open Computer Use – Open-Source Alternative to Codex Computer Use
Swift accessibilityai-agentai-agentsclaude-codecodexcodex-computer-usecomputer-usecomputer-use-agentcross-platformcuadesktop-automationgemini-cligui-automationmacosmcpmodel-context-protocolopen-computer-useopen-computer-use-mcpopenai-codexopencode
[2026-04-22 11:13] | Task: 对齐剩余 Computer Use tools 的默认行为
🤖 Execution Context
- Agent ID:
Codex - Base Model:
GPT-5 - Runtime:
Codex CLI
📥 User Query
click和set_value已经对齐,继续把其他 7 个 tool 一个一个过一遍,落 TODO,并按官方.app逆向结果对齐细节。
🛠 Changes Overview
Scope: OpenComputerUseKit tool surface / input routing, fixture smoke support, docs
Key Actions:
- [Execution Plan]: 新增 active plan,把剩余 7 个 tool 拆成 checklist,并记录官方
1.0.755的静态类型线索和验证命令。 - [scroll schema]: 将
scroll.pages从integer对齐到官方numberschema,支持 fractional pages,并补pages must be > 0与 invalid direction 的官方风格错误。 - [required string]: dispatcher 对 required string 统一拒绝空字符串,返回
Missing required argument: <name>,覆盖type_text/press_key/set_value/scroll等工具。 - [非物理 pointer 默认路径]:
scroll/drag默认改为CGEvent.postToPid定向事件;只有显式设置OPEN_COMPUTER_USE_ALLOW_GLOBAL_POINTER_FALLBACKS=1时才允许全局.cghidEventTap物理指针兜底。 - [Smoke fixture]: 为 SwiftPM 裸 executable fixture 保持强引用 delegate,并仅对内部
OpenComputerUseFixture注入 synthetic list identifier,恢复 9-tool smoke suite 覆盖。
🧠 Design Intent (Why)
官方 binary 暴露 MouseEventTarget、KeyboardEventTarget、EventTap、SystemFocusStealPreventer、UIElementScrollOperation 等类型,说明默认动作路由不是简单把 fallback 全部发到系统级硬件光标。开源版先把仍会移动真实鼠标或激活 app 的默认路径收掉:能用 AX action 就走 AX,不能时走 pid-targeted event;物理指针 fallback 只保留为显式调试开关。
📁 Files Modified
docs/exec-plans/active/20260422-remaining-tool-official-alignment.mddocs/ARCHITECTURE.mddocs/references/codex-computer-use-reverse-engineering/baseline-architecture.mdpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/AppDiscovery.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseService.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/ComputerUseToolDispatcher.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/Errors.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/FixtureBridge.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/InputSimulation.swiftpackages/OpenComputerUseKit/Sources/OpenComputerUseKit/ToolDefinitions.swiftpackages/OpenComputerUseKit/Tests/OpenComputerUseKitTests/OpenComputerUseKitTests.swiftapps/OpenComputerUseFixture/Sources/OpenComputerUseFixture/main.swift
🔁 Follow-up (2026-04-22, close remaining tool checklist)
- [具体化 milestones]: active plan 不再使用
里程碑 1/2/3占位,改成可执行的三项进度记录:官方证据基线、动作路径收敛、只读/键盘类复核和收尾。 - [secondary action 对齐]:
perform_secondary_action的 invalid action 错误改为官方 binary 暴露的字符串形态;fixture 的Raise路径不再调用 global pointer prepare。 - [press_key key table]: 根据官方
1.0.755binary 里的 key table 字符串,补齐BackSpace、Page_Up、Prior/Next、F1...F12和常见KP_*xdotool alias。 - [收口验证]: 官方
1.0.755app-servertools/list与本地 directtools/list的 9 个 tool surface 一致;swift test与 9-tool smoke suite 均通过。