zai-org / zai-org/feedback

Windows: get_app_state 观察零无障碍元素窗口(QQ音乐/TXGuiFoundation)导致 cua helper 崩溃,自动恢复后 MCP 无法重连

Open
#541 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

阻塞使用 · Blocking (无法使用核心功能 / core function unusable)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description
环境
  • ZCode 桌面版 3.11.2.6792,computer-use 插件 0.5.14
  • Windows 11 x64(内部版本 26200),模型通道 Z.ai
现象

computer-use helper 进程运行中崩溃,宿主自动拉起新一代 helper 并在日志报告 ready,但本会话内 MCP 层始终无法连接新 helper 的 socket:此后所有 computer-use 调用(包括只读的 list_apps)持续返回 CUA_NOT_READY / broker_not_accepting(permission broker socket is not accepting connections yet),等待 15 分钟以上无变化,只能重启 ZCode 恢复。

与 #405 不同:#405 是 helper 启动即退出(打包缺陷,exited before ready)。本例中 helper 正常启动并正常服务了约 10 分钟(list_apps、open_application 等均成功),随后被特定操作触发崩溃;且崩溃后的自动恢复没有把 MCP 会话重新接到新一代 helper 上。

触发条件(两次独立会话 2/2 复现)

对不暴露任何无障碍元素的自绘 UI 应用窗口执行 get_app_state(app_ref={pid})。复现应用:QQ音乐(窗口类名 TXGuiFoundation,UIA 全树枚举元素数为 0)。两个不同进程 pid(54716 / 9940),均在该调用后 helper 立即失联。

复现步骤 · Steps to reproduce
  1. 启动 ZCode,确认 computer-use 可用(list_apps 正常返回)
  2. 启动 QQ音乐(腾讯自绘 UI 框架 TXGuiFoundation,窗口不暴露任何 UIA/无障碍元素)
  3. Agent 对 QQ音乐进程执行 get_app_state(app_ref={pid: QQ音乐进程号})
  4. 该调用返回 CUA_NOT_READY / broker_response_ambiguous(connection_closed,响应丢失)——helper 进程此刻崩溃
  5. 宿主日志依次出现:Helper unreachable while host reports running (attempt 3); triggering resolver recovery,随后 Windows Computer Use Helper ready(generation N+1)
  6. 此后任何 computer-use 调用(含 list_apps)均返回 CUA_NOT_READY / broker_not_accepting,等待 15 分钟以上不恢复
  7. 重启 ZCode 后恢复;若再次 get_app_state 观察 QQ音乐窗口则再次崩溃(已复现两轮)
期望表现 · Expected behavior
  1. 对零无障碍元素窗口执行 get_app_state 应安全降级(返回空元素树 + 屏幕截图),不应导致 helper 崩溃
  2. 即便 helper 崩溃,自动恢复出新一代 helper 后,MCP 服务层应重新解析并连接新 helper 的 socket,会话内自动恢复可用
实际表现 · Actual behavior

新一代 helper 进程正常启动且宿主日志报告 ready,但 MCP 层对所有 computer-use 工具的调用始终返回 broker_not_accepting(socket is not accepting connections),本会话内 computer-use 永久不可用,必须重启 ZCode。两次独立会话均如此。

ZCode 版本 · ZCode version

3.11.2.6792(computer-use 插件 0.5.14)

设备 / 系统 / 浏览器 · Device / OS / Browser

Windows 11 x64(build 26200)/ ZCode 桌面版

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

~/.zcode/v2/logs/2026-09-06.log 关键行(两次独立会话,本地时间):

会话 A(00:20 启动):
[00:20:04] [cua-product-helper] Windows Computer Use Helper ready {generation:1, pid:38772}
[00:31:11] [cua-product-helper][trace:cua helper liveness] Helper unreachable while host reports running (attempt 3); triggering resolver recovery <- get_app_state(QQ音乐 pid 54716) 之后
[00:31:13] [cua-product-helper] Windows Computer Use Helper ready {generation:2, pid:60256}
(此后所有调用 broker_not_accepting,直至重启 ZCode)

会话 B(00:46 重启后):
[00:46:22] [cua-product-helper] Windows Computer Use Helper ready {generation:1, pid:49412}
[00:50:59] [cua-product-helper][trace:cua helper liveness] Helper unreachable while host reports running (attempt 3); triggering resolver recovery <- get_app_state(QQ音乐 pid 9940) 之后
[00:51:01] [cua-product-helper] Windows Computer Use Helper ready {generation:2, pid:20168}
(同样无法重连,等待 3 分钟以上无变化)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the recorded ~/.zcode/v2/logs/2026-09-06.log entries and reproduce get_app_state against a QQ音乐 window with no accessibility elements. Trace the helper crash and the subsequent MCP socket recovery after generation N+1 starts; done means get_app_state safely returns an empty element tree with a screenshot and later calls such as list_apps reconnect without restarting ZCode.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.