fix(mobile): 修复插件产物和调用状态的远程显示 - #4692
Conversation
Signed-off-by: zqchris <chrisz83@gmail.com>
|
Signed-off-by: zqchris <chrisz83@gmail.com>
|
Windows unit tests (2/2) 日志核对:失败为 updateService.test.ts 两项 spawn 等待断言,以及 mirrorCacheStore.test.ts 两项 20s 超时。这两个测试文件及其对应实现与 PR 基线无差异。本地以 --maxWorkers=2 定向复跑两文件,189/189 通过;不能据此宣称 Windows 已通过。 已尝试单独重跑失败 job,GitHub 返回 “The workflow run containing this job is already running” (403):Windows (1/2) 仍在执行。保留原断言与产品代码,待本轮结束后复核/重跑失败分片。 |
Signed-off-by: zqchris <chrisz83@gmail.com>
MagicLizi
left a comment
There was a problem hiding this comment.
Findings
- [P1] apps/mobile/src/session/MessageRenderer.tsx:3461 — 插件调用状态挂在用户气泡内部,但无正文/系统卡/secondaryBody 的附件消息会跳过整颗气泡。用户只发图/文件后触发插件时,调用中/已调用行、展开详情与公开图标都不会出现,与 PR 声称的「普通任务显示调用状态与详情」不符。建议把
PluginInvocationHeader移出该 skip,或把pluginInvocations?.length计入hasBubbleContent;用附件-only 用户消息加后续 ghost_call 做回归。验证:Mobile 定向单测覆盖该 render 路径,并在模拟器确认无正文附件消息仍显示调用行。
Rule coverage
- AGENTS.md / docs/dev-rules/development-workflow.md / PR 模板:单一目标是远程手机插件产物与调用状态;描述与 diff 范围一致,无夹带无关功能。未改原生配置/fingerprint。
- docs/dev-rules/plugin-security-and-authoring.md §5/§8:未改 receipt、manifest、包格式或安装布局;卡片/身份走只读 Remote Resource,不执行 HTML/脚本/动作。存量影响按描述为无。作者契约(FORGE_GUIDE)未改,无需手册同步。
- docs/dev-rules/remote-and-mobile-adaptation.md:复用既有 remote-resources get/changed 与 media:fetch;未改 device-link 重试/断链半径。手机入口已做,Description 写明适配。
- docs/dev-rules/media-storage-and-protocols.md:跨端只传托管 URL / 有界 data URL,不暴露宿主绝对路径;文件导出走既有 mediaFetch 受信通道。
- docs/dev-rules/electron-security-and-process-boundaries.md:Main 侧 provider 再授权、再校验 session 归属与 data-owner scope。
- docs/dev-rules/architecture-invariants.md:无新 package 反向依赖、无 main 动态 import、无布局树改动。
- docs/dev-rules/mobile-development.md 冷更边界:未改 app.json / 原生依赖 / fingerprint 输入。
- docs/dev-rules/protocol-compatibility.md:未改 wire schema;投影是控制端展示压缩,完整原文留宿主。
- DESIGN.md §2/§3/§5/§10/§14.4:新 UI 走语义 token、44pt 点击目标、召唤双弧与 reduced-motion。PR 描述写了 iOS 实机验证但未附截图/录屏/HTML(非阻断)。
- docs/design-rules/design-inventory.md:机器生成台账一行,不改变审查判据含义。
- security.softHits:apps/mobile/src/tests/pluginResultRendering.test.ts:51 为测试里拒绝转发的占位字段名,不是真实凭证。
Verification
- 已读完整 live diff、PR body、已 resolve 的 3 条 Greptile thread 及作者回复。
- 未在本 worktree 跑
pnpm test:unit:related/ typecheck:worktree 无 node_modules,禁止改工作区安装依赖。GitHub CIclient-ci与pr-design-basis对当前 head 为 success。 - 未执行 Android/真机/Dark 目检(作者已声明未做)。
Overall
changes-requested(1 条 P1;没有 P0)
|
命中 UI 路径(apps/mobile/app/sessions/[sessionId].tsx / apps/mobile/src/device-link/remoteResources.ts / apps/mobile/src/session/MessageRenderer.tsx 等)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范。这不是合并阻断。 |
Signed-off-by: zqchris <chrisz83@gmail.com>
|
Linux (1/2) failure traced to upstream billing translations: the merge-result checkout lacks 13 billing keys in all five Desktop locales. Current PR head passes i18nCompleteness (5/5), and Mobile tests passed in the failing CI shard. Main regression tracked separately in #4696 with deletion history and log evidence. No test exemptions or unrelated billing changes added to this PR; CI remains blocked until the upstream fix is available. |
|
Linux (2/2) adds two upstream integration failures, tracked with evidence in #4697: latest-catalogue sidebar restoration no longer matches its regression contract, and the auth initialization test harness lacks the newly referenced isCindyVersionLaunchPending dependency. Both suites pass on this PR branch (11/11); the merge-result checkout fails. Mobile tests passed in this shard too. verify only aggregates the Linux failures and has no independent failure. CI remains blocked by upstream #4696 and #4697; no assertions were weakened and no unrelated changes were added here. |
Signed-off-by: zqchris <chrisz83@gmail.com>
|
Attempt 2 still tested the old merge snapshot and reproduced the missing billing translations. Latest main now includes the relevant updates, so I merged 3c6bedf into this branch and pushed afec5d6 to trigger fresh merge-result CI. Local validation passed: Desktop unit suite (including all three previously failing tests), Mobile unit suite after refreshing the lockfile-defined Expo patch, maker-shared/cindy-tools unit suites, Desktop/Mobile typechecks, design inventory and DCO. No new product behavior changes were added. Awaiting the new CI run and re-review. |
Signed-off-by: zqchris <chrisz83@gmail.com>
|
Resolved the new conflict in dc374f4 by merging main 336b8a9 and regenerating the design inventory from the combined source. The only conflicted file was generated inventory; plugin behavior is unchanged and upstream share-bar changes are retained. Mobile unit gate, Mobile typecheck, inventory validation, diff check and DCO all passed. Awaiting fresh CI and re-review. |
MagicLizi
left a comment
There was a problem hiding this comment.
Findings
- 无 P0/P1。
Rule coverage
AGENTS.md/docs/dev-rules/development-workflow.md/.github/PULL_REQUEST_TEMPLATE.md:单一目标(远程手机保留插件产物与调用状态),模板三段齐全,风险写了协议/权限/跨平台与回滚。DCO 由既有门禁覆盖。docs/dev-rules/plugin-security-and-authoring.md§4–6:未改 receipt/指纹/manifest/安装布局/包格式;卡片远程投影剥 HTML/脚本/动作,身份只暴露公开名与有界 raster data URL;list()为空;get 绑定 session+callId 并二次授权。存量插件影响按用户可用性为无。作者契约(ghost.json/管子/FORGE_GUIDE)未改;hint 仅模型呈现口径。docs/dev-rules/remote-and-mobile-adaptation.md:复用既有 Remote Resource get/changed 与media:fetch,无新 IPC、无重试半径改动。手机入口已适配。Description 写明明确不包含桌面卡片按钮远程执行。docs/dev-rules/protocol-compatibility.md:collection/blocks 为字段追加;旧端忽略未知 collection。投影只改控制端可见副本,不改宿主行。docs/dev-rules/media-storage-and-protocols.md:不新建仓/协议;只传托管 URL。文件导出走既有device-link:media:fetch,用户点击才取件。docs/dev-rules/electron-security-and-process-boundaries.md:Main 侧授权+归属校验;Mobile 侧getRemoteResource只拷data.url,不转发 actions/secret。docs/dev-rules/credentials-and-local-storage.md:security.softHits 为测试桩占位(pluginResultRendering.test.ts:51,kind=credential-assignment),非真实凭证。docs/dev-rules/architecture-invariants.md:无 package 反向依赖 Desktop Main;无 main 动态 import。docs/dev-rules/mobile-development.md:无原生/fingerprint 改动。docs/design-rules/DESIGN.md:调用行用语义 token、44pt 点击目标、召唤双弧与 reduced-motion;无硬编码色。UI 证据缺失为非阻断,历史已有review-pr:ui-evidence-notice。docs/product-rules/core-product-principles.md:修远程产物丢失,不把插件 HTML/动作搬到手机。docs/dev-rules/engineering-conventions.md/i18n/GLOSSARY.md:五语 locale 同步;Plugin→插件。design-inventory 为生成清单登记PluginInvocationHeader。- 先前 thread:附件-only 气泡、逐调用配对、8KiB 预算均已在当前 head 落地且 thread 已 resolve。
Verification
- 前置:live context 与任务 head/base/diffHash 一致;gatePass=true;CI status=pass;unresolvedThreads=0;staleRebase 不阻塞;authorIsMaintainer 故审查前不 hold。
- 定向单测:独立 worktree 无 node_modules,
pnpm --filter desktop exec vitest退出 254(Command "vitest" not found)。未把未运行写成通过。作者声明相关单测/typecheck 已过;本轮以 GitHub CI 全绿为合并证据。 - 未执行:Android/Dark 目检、完整远程发送链路(作者已声明)。不构成 P0/P1。
- botSettle:已等 ≥20 分钟超时放行;copilot-pull-request-reviewer / chatgpt-codex-connector 意见可能在合并后到达。
Overall
pass(没有 P0/P1)
这次改了什么
摘要
修复 Art 等插件产物在远程手机上丢失的问题:工具结果和历史压缩保留图片、音视频、文件及卡片引用,手机用原生组件展示可读内容。补齐普通任务用户消息内的插件调用状态、展开信息与图标;伙伴用户消息继续保持普通气泡,产物和授权卡独立显示。 插件状态按各次调用的配对结果独立结束;大结果投影限制为 8 KiB,优先保留完整引用,完整原文仍保留在宿主。
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
UI 变化
iOS:原生插件调用行、运行双弧动画、完成标记、展开详情及只读结果。截图包含真实消息,未附公开截图。
怎么验证的
自动验证
本次状态与预算修复(232dffab7)追加验证:
pnpm test:unit:related -- --workspace apps/desktop --workspace apps/mobile、Desktop/Mobile typecheck 均通过;Desktop 定向 84 项、Mobile 定向 29 项通过。新增覆盖并发插件独立完成、重复调用、空/失败结果,以及大量引用和 Unicode 内容的最终字节预算。本次未追加模拟器实测。新增回归覆盖嵌套结果、压缩引用保留、卡片归属及账号切换、迟到响应、重连恢复、媒体去重、调用归属及伙伴授权/产物并存。
手工验证
iOS 模拟器中的真实远程任务验证:Art 图片缩略图、全屏打开、退出重进后的历史显示;插件运行/完成状态、展开/收起详情。复用现有已登录宿主,没有启动 Mac 预览版。
branch/worktree:plugin-mobile-results / cindy-plugin-mobile-results;Metro 为此 worktree 专属实例(8081);DEV build label:plugin-mobile-results@88f491e+0a4a4de690。提交前已同步主干 b4ffa2a 并重新运行自动检查;未为此次基线同步重装模拟器原生包。
附件-only 修复(6982f6a90):Mobile 全部单测及 typecheck 通过;新增实际 MessageRenderer 渲染回归覆盖纯图片/文件的调用中、完成状态和伙伴/无调用对照(4 项)。iOS 27 Light 下用临时无私密数据样例挂载真实组件,核验无正文文件的 Calling… → Called 及展开详情;临时页面未提交,不等同于远程发送链路重新验收。
未执行的验证
Android 和手机真机、Dark 模式目检、视频/音频/文件系统分享、伙伴端到端、升级宿主后的卡片与自定义插件图标未全链路实测;对应代码与回归测试已核对。模拟器的本地原生启动适配未纳入提交,不改变 runtime fingerprint。
风险
风险分类
影响与回滚
提交前检查