
Open Computer Use 开发者指南源码构建、smoke 测试与 agent 冒烟验证完整流程【免费下载链接】open-codex-computer-use Open Computer Use – Open-Source Alternative to Codex Computer Use项目地址: https://gitcode.com/gh_mirrors/op/open-codex-computer-useOpen Computer Use 是一个把 Computer Use 能力封装成 MCP 服务的开源项目Codex Computer Use 的开源替代版支持 macOS、Linux 与 Windows。本文面向新手开发者带你走通三条核心验证链路源码构建、smoke 测试、agent 冒烟验证并附压力测试与推送前检查清单。1. 环境准备构建 Computer Use 源码的前置条件工具用途最低版本Swift Xcode CLI编译 macOS 运行时与测试套件随 Xcode 提供Node.js运行 agent 冒烟验证脚本18make一键调度构建/测试命令系统自带⚠️ macOS 运行时要求 macOS 14.0 或更高版本首次使用需授予「辅助功能」与「屏幕录制」权限可用open-computer-use doctor检查。获取源码git clone https://gitcode.com/gh_mirrors/op/open-codex-computer-use cd open-codex-computer-use2. 源码构建make build 一键编译所有命令都集中在根目录的 Makefile 里常用入口如下make build # swift build产出 .build/debug 下的可执行文件 make test # swift test Node REPL 单元测试swift build会编译出 4 个关键产物定义在 Package.swift 中OpenComputerUseMCP 服务主程序提供 9 个 Computer Use 工具list_apps、click、type_text等OpenComputerUseFixture冒烟测试用的「靶场」应用内置计数器按钮、文本框、按键捕获区、滚动区与拖拽区OpenComputerUseSmokeSuite端到端 smoke 测试执行器OpenComputerUseKit底层能力库可访问性快照、输入模拟、MCP 服务等构建成功后可执行文件位于.build/debug/可用open-computer-use capabilities或ocu capabilities --json查看运行时能力。3. smoke 测试make smoke 全流程冒烟验证smoke 测试是本项目最核心的质量门禁入口是 scripts/run-tool-smoke-tests.sh它会先swift build然后跑两轮OpenComputerUseSmokeSuite第一轮完整工具链冒烟见 OpenComputerUseSmokeSuite/main.swift启动OpenComputerUseFixture靶场应用支持 headless 模式通过 JSON-RPC 启动 MCP 服务断言工具数量恰好为 9依次执行并逐一断言list_apps→get_app_state→ 按元素索引点击计数器 1→ 按坐标点击计数器 2→ 窗口Raise次级操作 →set_value写文本 →type_text追加文本 →press_key捕获 Return →scroll滚动 →drag拖拽第二轮光标 idle 冒烟--cursor-idle-only开启视觉光标OPEN_COMPUTER_USE_VISUAL_CURSOR1并写入观察文件验证空闲光标「锚点稳定 微小旋转晃动」的官方对齐行为防止视觉光标在无人操作时乱漂。make smoke想加大力度就做压力测试循环执行 N 轮完整冒烟每轮含 10 个 fixture 操作并输出 JSON 汇总见 scripts/run-tool-stress-tests.shOPEN_COMPUTER_USE_STRESS_LOOPS20 make stress4. agent 冒烟验证让真实 AI Agent 执行 Computer Use 任务这是项目特色不只看「工具返回对不对」而是让真实 AgentClaude / Codex / Hermes通过 MCP 完整跑一遍 Computer Use 工作流。脚本是 scripts/run-agent-smoke-tests.mjs三种场景由浅入深场景参数Agent 需要做的事列表应用list-apps只调一次list_apps基础 fixturefixture读状态 set_value 点击按钮完整 fixturefixture-full额外完成type_text、press_key、次级操作、scroll、drag共 8 类操作验证是「双重确认」既要求 Agent 回复约定的OPEN_CU_AGENT_OK又独立复查 fixture 的真实状态文本值精确匹配、计数器恰好为 1、滚动偏移与拖拽状态都已变化杜绝 Agent「嘴上说完成、实际没生效」。# 最常用claude codex 双 Agent 跑 list-apps make agent-smoke # 指定更完整的场景 make agent-smoke SCENARIOfixture-full # 直接调脚本可换 Agent、换命令 node ./scripts/run-agent-smoke-tests.mjs --scenariofixture --agentsclaude,codex --commandopen-computer-useHermes 需要额外指定 provider/model参考 README.md 中的make agent-smoke AGENTShermes示例。5. 推送前检查清单make ci 与文档门禁按 CONTRIBUTING.md 的要求发起 Pull Request 前请跑完make check-docs # 文档检查 make check-repo # 文档 仓库卫生检查 make ci # 完整 CI文档、脚本语法、Node 测试、Linux/Go 测试等make ci对应 scripts/ci.sh覆盖文档校验、全部 shell/Node 脚本语法检查、Node REPL 单测、Linux runtime 单测以及 Windows/Linux 的 Go 测试与 CI 流水线见 docs/CICD.md保持一致。6. 速查表开发者指南一张图目标命令关键文件源码构建make buildMakefile单元测试make testPackage.swiftsmoke 测试make smokescripts/run-tool-smoke-tests.sh压力测试make stressscripts/run-tool-stress-tests.shagent 冒烟验证make agent-smokescripts/run-agent-smoke-tests.mjs推送前检查make ciscripts/ci.sh 推荐的新手验证顺序make build→make test→make smoke→make agent-smoke→make ci。走完这条链路你就完整掌握了 Open Computer Use 从源码到上线的全套验证方法。【免费下载链接】open-codex-computer-use Open Computer Use – Open-Source Alternative to Codex Computer Use项目地址: https://gitcode.com/gh_mirrors/op/open-codex-computer-use创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考