Computer Use 光标 overlay 动画阻塞动作返回,move_cursor 耗时随距离增至 1~5 秒
- Dominant language
- TypeScript
- Stars
- 2.7k
- Forks
- 395
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 776
Description
**提交人**: 大佬
**客户端版本**: 0.1.61
---
## 现象
启用「自动操作电脑」(Computer Use) 后,鼠标类动作明显迟缓:单次 `move_cursor` 耗时 1~5 秒,而同一环境下所有只读类工具都是毫秒级。
agent cursor overlay 文档说明该叠加层"显示 agent 在哪里操作,而不移动真实指针"(without moving the real pointer),即它是纯装饰层。但实测耗时与移动距离强相关,表现为**动作调用会等待 overlay 动画播放完毕才返回**,装饰层实际阻塞了真实操作的返回时机。
## 复现步骤
1. macOS (Apple Silicon) 上启用「自动操作电脑」,driver 正常安装、权限已授权
2. 通过 MCP 连续调用 `move_cursor`,分别指定不同移动距离
3. 记录每次调用的往返耗时
## 期望行为
真实指针移动通过 synthetic events 下发,应当在毫秒级返回;装饰性的 overlay 动画不应阻塞动作调用的返回。
## 实际行为
**耗时随移动距离线性增长(同机连续测量):**
| 移动距离 | 耗时 |
|---|---|
| 14 px | 1056 ms |
| 20 px | 1062 ms |
| 20 px | 1069 ms |
| 40 px | 1107 ms |
| 440 px | 1676 ms |
| 1372 px | 2816 ms |
| 1924 px | 4827 ms |
极短距离(<60px) 平均 1074 ms;长距离(>800px) 平均 3860 ms。存在约 1 秒的固定起步开销,其余按距离叠加。
**同一环境下的只读工具对照组:**
| 工具 | 耗时 |
|---|---|
| `get_screen_size` | 7 ms |
| `get_cursor_position` | 6 ms |
| `get_window_state` (vision) | 6 ms |
| `get_accessibility_tree` | 20 ms |
| `list_windows` | 44 ms |
"看"与"动"相差约三个数量级。
**overlay 默认动画参数(`get_agent_cursor_state` 返回):**
```
spring: 0.72
turn_radius: 80
dwell_after_click_ms: 80
glide_duration_ms: 0
```
弹簧缓动加转弯弧线,恰好可以解释"距离越长动画越久、耗时越长"的曲线。
实际影响:一个包含约 20 次点击的任务,仅 overlay 动画就会额外消耗 40 秒以上,而实际操作部分是毫秒级。
## 附带问题:动画参数未暴露给用户
当前只能在 `cua-driver serve` 启动时通过三个开关调节 overlay:`--no-overlay`、`--cursor-theme`、`--cursor-reduced-motion`。`spring` / `turn_radius` / `dwell_after_click_ms` 等参数没有任何用户可调入口。
而桌面端的 daemon 由 Cindy 自行拉起(`cua-driver serve --no-permissions-gate`),用户无法修改这些启动参数,因此 `--cursor-reduced-motion on` 这个折中方案在桌面端事实上不可用。
用户当前只能在"慢但看得见 AI 在操作"和"完全关掉 overlay"之间二选一,缺少中间档。
## 复现频率
必现。
## 已尝试
- 确认 driver 正常:`cua-driver 0.18.0`,daemon 运行中,辅助功能与屏幕录制权限均已授权
- 查找本地配置文件:`~/.cua-driver/` 下无任何 overlay 相关配置项
- 查阅 CLI `--help`:确认动画参数未开放,且相关开关只能在 daemon 启动时设置
## 建议
1. 让 overlay 动画与动作返回解耦,动画异步播放,动作调用立即返回
2. 在桌面端设置中提供光标动效档位(如 完整动画 / 精简动画 / 关闭),映射到 `--cursor-reduced-motion`,让用户不必修改 daemon 启动参数
---
**OS**: darwin arm64 (25.5.0)
**界面语言**: zh-CN
Contributor guide
Research direction
Start by tracing the MCP move_cursor entry point and the desktop daemon's agent-cursor overlay animation, then reproduce the reported distance-dependent timings on macOS. Done means the action return is no longer delayed by decorative animation and the desktop client provides the requested reduced-motion setting or clearly documents the supported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- electron, typescript
- Domain
- desktop, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100