feat(computer-use): use @qwen-code/open-computer-use fork (signed + notarized) - #4726
Conversation
…e@0.2.2 Switch the deferred Computer Use MCP server from upstream `open-computer-use` to the QwenLM fork `@qwen-code/open-computer-use`, published to npm (signed + notarized, pinned at 0.2.2). - constants.ts: add PINNED_OPEN_COMPUTER_USE_PACKAGE_NAME (@qwen-code/open-computer-use); pin 0.2.2; resolveComputerUsePackageSpec() composes name@version. - sync-computer-use-schemas.ts: default to the scoped package + 0.2.2. - schemas.ts: header refresh — tool surface is unchanged across 0.2.0→0.2.2, so the hardcoded 9-tool schemas need no content change. - Test/doc sample specs updated to the scoped name. permission-detector tests keep `open-computer-use doctor` — only the npm package is scoped; the installed CLI binary is still named `open-computer-use`.
📋 Review SummaryThis PR integrates the QwenLM fork of 🔍 General Feedback
🎯 Specific Feedback🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
…e@0.2.3 Switch the deferred Computer Use MCP server from upstream `open-computer-use` to the QwenLM fork `@qwen-code/open-computer-use`, published to npm (signed + notarized, pinned at 0.2.3). 0.2.3 includes the screenshot env-var controls (OPEN_COMPUTER_USE_IMAGE_*), the window-free `permission-status` command, and the minScale-clamp fix (small MAX_DIMENSION now downsamples to the minScale floor instead of falling back to the full-size original). - constants.ts: add PINNED_OPEN_COMPUTER_USE_PACKAGE_NAME (@qwen-code/open-computer-use); pin 0.2.3; resolveComputerUsePackageSpec() composes name@version. - sync-computer-use-schemas.ts: default to the scoped package + 0.2.3. - schemas.ts: header refresh — 0.2.0→0.2.3 changes don't alter the MCP tool surface, so the hardcoded 9-tool schemas are unchanged. - Test/doc sample specs use the scoped name. permission-detector tests keep `open-computer-use doctor` — only the npm package is scoped; the installed CLI binary is still named `open-computer-use`.
b829d41 to
145c56d
Compare
E2E 验证报告:截图尺寸/体积约束(根本需求)验证目标确认「通过环境变量控制截图尺寸与大小约束」端到端生效。 方法对已发布的 OPEN_COMPUTER_USE_IMAGE_MAX_DIMENSION=480 \
npx -y @qwen-code/open-computer-use call get_app_state --args '{"app":"Finder"}'结果(0.2.2 = clamp 修复前,0.2.3 = 修复后)
第三行是关键证据:0.2.2 在 同时验证的两项
结论✅ 根本需求(env 控制截图尺寸/体积)端到端生效;clamp 边缘 bug 已在 0.2.3 修复,fork swift 单测确定性覆盖(
|
截图尺寸/大小约束 — 配置与生效逻辑文档完整文档已随 fork 发布:QwenLM/open-computer-use · docs/IMAGE_CAPTURE.md。下面贴正文便于 review。 截图捕获与尺寸约束本文档说明 Open Computer Use 在 macOS 上如何捕获截图、如何对截图做尺寸与体积约束,以及新增的
1. 截图什么时候产生截图由 每次都是「现拍」——动作执行后重新捕获目标 window,反映动作执行之后的状态。 实现入口: 2. 捕获 → 降采样 → 编码 三段式管线① 捕获(native 分辨率)
let scaleFactor = bestEffortScaleFactor(for: bounds) // 屏幕 backingScaleFactor,Retina = 2
configuration.width = max(1, Int(ceil(captureSize.width * scaleFactor)))
configuration.height = max(1, Int(ceil(captureSize.height * scaleFactor)))
configuration.showsCursor = false
configuration.ignoreShadowsSingleWindow = true所以 Retina 屏上拿到的是 native 像素图(例如一个 920×304 logical 的窗口 → 1840×608 native pixels)。捕获有超时保护( ② 降采样(尺寸/体积约束)
let largestDimension = max(image.width, image.height) // native 长边
var scale = max(min(1, maxDimension / largestDimension), minScale) // ← 关键:夹在 [minScale, 1]
if scale >= 1 && originalPNG.count <= maxBytes {
return originalPNG // 原图已经够小,直接用
}
var best = originalPNG
while scale >= minScale {
let data = pngEncode(resize(image, scale))
best = data
if data.count <= maxBytes { return data } // 满足字节预算,返回
scale *= 0.85 // 否则继续缩 15%
}
return best // 触及 minScale 下限,返回当前最优三个约束的协作关系:
③ 编码缩放后的 3. 环境变量逐项说明所有变量可选、在每次截图捕获时实时读取(改了无需重启)。缺失 / 非数字 / 越界的值会回落到默认值。前后空格 / tab / 换行会被忽略。
默认行为速记
4. 降采样不破坏点击精度降采样不会让坐标点击失准。坐标类工具( 实现:
5. 实测示例对一个 native 长边 ≈1840px 的 Finder 窗口(同一窗口、仅改 env):
第三行是 6. 通过 Qwen Code 使用Qwen Code 把 Open Computer Use 作为内置 MCP server( export OPEN_COMPUTER_USE_IMAGE_MAX_DIMENSION=640
export OPEN_COMPUTER_USE_IMAGE_MAX_BYTES=120000
# 需要更小的图时再加:
# export OPEN_COMPUTER_USE_IMAGE_MIN_SCALE=0.1
qwen # 之后所有 computer_use__get_app_state / action 工具的截图都按此约束直接用 CLI 验证(不经过模型): OPEN_COMPUTER_USE_IMAGE_MAX_DIMENSION=480 \
npx -y @qwen-code/open-computer-use call get_app_state --args '{"app":"Finder"}'7. 平台差异
附:版本说明
|
|
Thanks for the PR! This is a well-scoped change with clear motivation. Template: the PR body doesn't follow the PR template — it uses custom headings ( On direction: Repointing the built-in Computer Use MCP server to a QwenLM-maintained fork is clearly aligned with qwen-code's mission. Maintenance control over a zero-config built-in that ships to end users is a strategic necessity — you can't rely on an upstream you don't control for something this tightly coupled. The signed + notarized macOS On approach: The scope feels right — two logical changes (repoint + window-storm fix), 10 files all within Moving on to code review. 🔍 中文说明感谢 PR!范围清晰、动机明确。 模板: PR body 没有使用 PR 模板 的必填结构( 方向: 将内置 Computer Use MCP server 切换到 QwenLM 维护的 fork,方向完全对齐。对零配置内置组件拥有维护控制权是战略必需。签名 + 公证的 macOS 方案: 范围合理——两个逻辑变更(切换 fork + 窗口风暴修复),10 个文件全部在 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code ReviewThe implementation is clean and well-scoped. I independently thought through the window-storm fix before reading the diff — the natural solution is "call No critical blockers. No AGENTS.md violations. Specific observations:
Real-Scenario TestingVerified the fork package and the fallback path via tmux: Key takeaways:
Full window-storm E2E (revoke macOS permissions → trigger bootstrap → observe single window) couldn't be reproduced in tmux without destructively revoking TCC permissions. The author's E2E report in the PR comments covers this scenario with manual macOS testing. 中文说明代码审查实现干净、范围合理。在读取 diff 之前我独立思考了窗口风暴修复方案——自然的解法是"调一次 无关键阻塞问题,无 AGENTS.md 违规。具体观察:
实际场景测试通过 tmux 验证了 fork 包和降级路径:
完整的窗口风暴 E2E(撤销 macOS 权限 → 触发 bootstrap → 观察只弹一个窗口)无法在 tmux 中复现(需要破坏性地撤销 TCC 权限)。作者在 PR 评论中的 E2E 报告已覆盖此场景。 — Qwen Code · qwen3.7-max |
|
Stepping back to look at the whole picture: this PR does two things well. The fork repoint gives the team maintenance control over a critical built-in dependency and ships a signed + notarized macOS app — a real first-impression improvement. The window-storm fix is the kind of bug that looks minor in code but is deeply frustrating for users hitting it for the first time, and the fix is surgical: one The implementation matches what I would have done independently. The code is straightforward — no over-engineering, no speculative abstractions. The comments explain why (binary name vs package name, LaunchServices not deduping, the fallback path), which is exactly what a future maintainer needs. Tests cover the behavioral contract, not just the happy path. The tmux evidence confirms the fork package works, the fallback path is real, and the package spec resolves correctly. The author's E2E report covers the full macOS permission flow that I can't reproduce non-destructively. Approving. ✅ 中文说明从整体审视:这个 PR 做好了两件事。切换到 fork 让团队对一个关键内置依赖拥有维护控制权,同时发布了签名 + 公证的 macOS app——这是真实的首次使用体验提升。窗口风暴修复是那种代码看起来小、但对首次使用的用户来说非常恼火的 bug,修复方式精准:一次 实现与我独立设想的方案一致。代码直截了当——没有过度工程、没有投机性抽象。注释解释了 why(二进制名 vs 包名、LaunchServices 不去重、降级路径),正是未来维护者需要的信息。测试覆盖了行为契约,不仅是 happy path。 tmux 证据确认 fork 包可用、降级路径真实存在、包 spec 解析正确。作者的 E2E 报告覆盖了无法非破坏性复现的完整 macOS 权限流程。 批准。✅ — Qwen Code · qwen3.7-max |
pomelo-nwu
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
What
Point qwen-code's built-in Computer Use MCP server at the QwenLM fork
@qwen-code/open-computer-use@0.2.2instead of upstreamopen-computer-use, and fix an onboarding-window storm in thepermission bootstrap.
Why the fork
The fork (https://github.com/QwenLM/open-computer-use) gives us
maintenance control over the desktop-automation binary qwen-code ships
as a zero-config built-in:
.app(Developer ID: Alibaba Cloud(Singapore) Private Limited) — first launch has no Gatekeeper warning.
OPEN_COMPUTER_USE_IMAGE_*env overrides for screenshotdimension / byte budget (macOS).
permission-statusCLI command (added in 0.2.2) — seethe window-storm fix below.
@qwen-codenpm scope we control.Changes
Repoint to the fork (commit 1)
constants.ts: addPINNED_OPEN_COMPUTER_USE_PACKAGE_NAME(
@qwen-code/open-computer-use); pin0.2.2;resolveComputerUsePackageSpec()composes name@version.sync-computer-use-schemas.ts: default to the scoped package + pin.schemas.ts: header refresh — the MCP tool surface is unchangedacross 0.2.0→0.2.2, so the hardcoded 9-tool schemas need no content
change.
permission-detectortests intentionally keep
open-computer-use doctor: only the npmpackage is scoped; the installed CLI binary is still named
open-computer-useand its error strings use that name.Fix onboarding-window storm (commit 2)
doctorevery 5s while waiting for the user togrant macOS permissions.
doctorre-launches a fresh onboarding windowon every invocation (it does not dedup), so the poll loop flooded the
screen with windows.
doctorprobe), then poll the window-free
permission-statuscommand on everyiteration. The single onboarding window stays open; no new windows
spawn during the wait. "Grant then auto-continue" UX is preserved.
permission-statusis unknown (older pinnedpackage), the poll returns 'other' and exits without a storm.
Verification
npx -y @qwen-code/open-computer-use@0.2.2 mcpspawns and returns theexpected 9 tools over MCP stdio.
package; permissions flow opens a single onboarding window (no storm);
after granting, the tool call resumes and returns a screenshot;
notarized
.applaunches with no Gatekeeper warning.