zai-org / zai-org/feedback

[Bug] 手机远程控制打不开大会话:报 fault.subscription.recoveryFailed,实际是中继帧超限 remote.rpcFrame.messageTooLarge

Open
#228 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

问题类别 · Category

稳定性 / 崩溃 · Stability / Crash

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major(手机端远程控制无法打开大会话,桌面端功能正常)

复现频率 · Reproducibility

必现 · Always(会话越大越必现)


问题描述 · Description

手机端远程控制(web-remote-control)打开大会话(数百条消息)时失败,页面报 fault.subscription.recoveryFailed("重新连接"按钮)。但该错误码有误导性:与订阅/登录/套餐无关(订阅相关 RPC 全部正常)。桌面端日志显示真实原因是远程中继单个 RPC 帧超限

reasonCode: remote.rpcFrame.messageTooLarge

触发后中继桥接反复"降级 → 恢复"循环失败,手机端一直无法打开该会话。小会话(几十条消息)打开正常。

复现步骤 · Steps to reproduce

  1. 桌面端 ZCode 开启远程控制,手机浏览器扫码连接 zcode.z.ai;
  2. 在"任务会话"列表点击打开一个大会话(实测:276 条消息、eventSeq ~6988、会话 rollout 数据约 55MB);
  3. 页面报 fault.subscription.recoveryFailed,出现"重新连接"按钮;
  4. 反复点"重新连接"/重开,持续失败;此时桌面端日志出现 web-remote-control raw relay bridge degraded + remote.rpcFrame.messageTooLarge + recover-start 循环;
  5. 对比:打开小会话(约 23 次请求、4MB)完全正常。

期望表现 · Expected behavior

手机远程控制应能打开任意任务会话(包括超大会话);若会话超过中继帧上限,应提供降级方案(如只同步最近 N 条消息 / 分页加载),而不是直接报错失败。

实际表现 · Actual behavior

  • 大会话在手机上完全无法打开,报误导性错误 fault.subscription.recoveryFailed(用户会误以为是订阅/计费问题,实际与订阅无关);
  • 桌面日志显示中继桥接反复降级:remote.rpcFrame.messageTooLargebridgeGeneration 2→3→4→5 连续循环,recover-start 反复触发,始终无法恢复;
  • 错误码与实际原因不符,用户无法自行定位。

ZCode 版本 · ZCode version

3.7.3(macOS 桌面端)

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

  • 手机端:iPhone / iOS,5G 网络,浏览器访问 zcode.z.ai 远程控制页
  • 桌面端:macOS(Apple Silicon),ZCode 3.7.3

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

桌面端日志(~/.zcode/v2/logs/2026-08-10.log,时间 2026-08-10 13:30,反复点击重开时;设备 SID / 桥接 ID 等标识符已脱敏):

[13:30:35.335] [warn] [web-remote-control] raw relay bridge degraded {"windowId":1,"session":"d_<deviceSid>","bridgeSessionId":"bridge-<id>","bridgeGeneration":2,"recoveryId":"recovery-<id>","reasonCode":"remote.rpcFrame.messageTooLarge"}
[13:30:35.755] [info] [web-remote-control] mobile diagnostic {"event":"recover-start","state":"paired","visibilityState":"visible","online":true}
[13:30:38.885] [warn] [web-remote-control] raw relay bridge degraded {"bridgeGeneration":3,"recoveryId":"recovery-<id>","reasonCode":"remote.rpcFrame.messageTooLarge"}
[13:30:41.861] [warn] [web-remote-control] raw relay bridge degraded {"bridgeGeneration":4,"recoveryId":"recovery-<id>","reasonCode":"remote.rpcFrame.messageTooLarge"}
[13:30:45.603] [warn] [web-remote-control] raw relay bridge degraded {"bridgeGeneration":5,"recoveryId":"recovery-<id>","reasonCode":"remote.rpcFrame.messageTooLarge"}

会话状态(zcode-session-service readSession):大会话 eventSeq 6988、276 条消息;手机端每次尝试都伴随上述 bridge 降级循环。

数据量对比佐证(会话 rollout,~/.zcode/cli/rollout/,会话 ID 已脱敏):

  • 打不开的会话:model-io-sess_<sessionId>.jsonl — 55MB / 212 次请求 / 276 条消息
  • 能打开的会话:model-io-sess_<sessionId>.jsonl — 4MB / 23 次请求

建议:① 大会话同步时只下发最近 N 条消息或分页拉取;② fault.subscription.recoveryFailed 这个错误码与实际原因(messageTooLarge)不符,建议让手机端透出真实原因,避免用户误判为订阅/计费问题。

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 web-remote-control relay handling and zcode-session-service readSession path, using the supplied 276-message session and desktop log as a reproduction. Trace how remote.rpcFrame.messageTooLarge becomes fault.subscription.recoveryFailed and how recovery retries. Done means large sessions load through bounded or paged data, or the mobile UI exposes the actual failure reason without looping.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, macos
Domain
distributed-systems, mobile, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.