Skip to content

[Bug] computer-use 0.6.3 (macOS): 后台键盘合成被系统性拒绝 bounds_mismatch — typeText/paste 全断,GUI 文本注入无可用路径 #820

Description

@YFOOOO

使用环境

  • macOS (Apple Silicon) / ZCode desktop v3.14.3
  • computer-use 插件 0.6.3(官方市场最新版);helper "ZCode Computer Use" 3.14.3
  • 权限正常:辅助功能已授权(对照实验:Finder getAXState 正常返回 79 元素)、屏幕录制已授权、全程无权限弹窗

问题摘要

后台键盘合成在 begin 阶段被系统性拒绝,错误形如:

macOS background keyboard begin rejected: reason=bounds_mismatch. action_sent=false.
expected_bounds=[...] live_bounds=[...]

typeText 与 paste(两者共用键盘管线)100% 被拒,且与目标应用无关——agent 无法向任何 GUI 应用注入文本。

最小复现(TextEdit,原生应用)

  1. getApp("TextEdit"),窗口存在且可见;
  2. app.typeText("hello") → bounds_mismatch 拒绝,3+ 次稳定复现;
  3. 对照:app.setValue(index, text) 成功(仅 AX 可设元素可用);
  4. app.paste(…) → 同样 bounds_mismatch。

一次典型拒绝的原始数据:expected_bounds=[520,165,880,448](观察时的目标窗口),live_bounds=[15,776,130,121](拒绝时刻——这是一个 130×121 的左下角小窗,不是目标应用的任何窗口,且尺寸稳定、非动画中间态)。

已排除项

  • 权限问题(见环境,Finder AX 读取正常);
  • 版本偏差(helper 与 app 同为 3.14.3,插件已是市场最新);
  • 目标应用特异性(TextEdit[原生] 与一个 Tauri/WKWebView 应用双复现);
  • 动画/瞬态(live_bounds 稳定不变)。

根因假设(推断级,helper 未开源无法源码确认)

keyboard-begin 的窗口身份/边界校验似乎把某个小浮层当成了焦点窗口(候选:CUA 自身 PiP 悬浮层、输入法候选窗、通知)。若如此,凡存在此类浮层的机器上后台键盘必然全灭,与"系统性失效"观察吻合。同族先例:#380(Windows 坐标点击 "dispatch app/window identity does not match frame")在 0.5.14 以 stable_identity 修复——怀疑这是同一校验子系统的 macOS keyboard 分支。

复合效应(严重性)

在 WKWebView 受控组件(React 式输入框)上,setValue 被 UI 静默忽略(API 接受但组件无变化、发送按钮保持 disabled),而 typeText/paste 又被本 bug 拒绝 → 对现代 web UI 应用完全不存在文本注入路径。

文档缺口(顺带)

  1. bounds_mismatch 不在 computer-use.md 的错误码表(19 项)中;
  2. 文档称后台 app 的 paste 应报 FOREGROUND_REQUIRED,实际报 bounds_mismatch。

期望

  1. 修复 keyboard-begin 的窗口校验(可参考 zcode-cua 0.5.12 (Windows): all raw coordinate clicks refused with 'dispatch app/window identity does not match frame' #380 的 stable_identity 思路);
  2. 将 bounds_mismatch 写入错误码文档,说明触发条件与 retry 语义。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions