Skip to content

fix(bots): 补齐三端伙伴过程与回复头像 - #8864

Merged
MagicLizi merged 3 commits into
makecindy:mainfrom
zqchris:companion-process-avatar
Nov 4, 2026
Merged

MagicLizi merged 3 commits into
makecindy:mainfrom
zqchris:companion-process-avatar

Conversation

@zqchris

@zqchris zqchris commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

这次改了什么

摘要

伙伴私聊的工作过程此前只留了透明头像占位,无法直接看出是谁在处理。Desktop、iOS、Android 现在在过程区和最终回复各显示一个当前伙伴头像,展开的中间文字和工具明细不重复显示。

变更类型

  • fix 缺陷修复

范围

  • 关联需求:补齐三端伙伴头像,采用「过程和回复各一个」。
  • 本 PR 包含:桌面过程外层头像、手机共用渲染器头像行、现有回归及设计规范同步。
  • 明确不包含:头像资产、群聊、普通任务、过程聚合或计时规则、原生配置。
  • 用户可见变化:运行中和完成后都可看到过程头像,正文与回复保持对齐。
  • 是否存在 breaking change:无。

UI 变化

  • 引用的设计规范:docs/design-rules/DESIGN.md §5、§7、§14「伙伴私聊消息下操作」;复用现有头像、间距及正文列,两种主题使用现有语义样式,不新增颜色或尺寸。
  • 以下均为真实组件和免登录合成数据,不代表真实账号或 Agent 执行验收。
  • 截图来源:单页验证 pnpm ui:check --changed --theme all,macOS · Electron 42.11.12(Chromium 148.0.7778.280,与 Cindy 同一渲染内核);真实组件与主题,场景数据,不是登录账号下的完整 Cindy
  • 版本:3568430ec375(含未提交改动)
  • 结果:36/36 个场景通过
  • 页面 mcp-inline-form:light / dark · zh-CN · 600×1000 / 320×1100 / 600×600
    • default:The existing Settings form expanded in the message flow
    • narrow:Inline form at 320 px
    • invalid:Original validation and focus in the embedded form
    • result-error:Saved configuration remains saved when result delivery fails; retry and cancel remain available
    • settings:Original modal remains a modal
    • layout:Production message scrollport carries the entire form; composer stays fixed
    • 未覆盖:OS safeStorage, real account switching, MCP network connections and vendor model calls use separate checks; host APIs here return fixture results.
    • 场景替换的模块(未验证):src/renderer/components/chat/GhostToolCard
  • 页面 message-focus:light / dark · zh-CN · 900×600
    • default:Ordinary task message navigation
    • compact:Companion message navigation
    • 未覆盖:Host search transport, native mobile, agent execution
    • 场景替换的模块(未验证):src/renderer/components/chat/GhostToolCard
  • 页面 teammate-process:light / dark · zh-CN · 720×850 / 320×850 / 640×950
    • default:Live private turn with stage notes and initial thinking
    • finished:Completed private turn with final answer outside
    • retry:Two failed attempts followed by a running read: current action stays visible
    • artifacts-wide:Avatar, long reply, Excel preview and related file align in the production stream
    • artifacts-narrow:A narrow companion column preserves card sizing
    • artifacts-thread:The production topic panel and compact styles retain reply/artifact alignment
    • artifacts-no-avatar:No avatar means no additional inset
    • artifacts-task:Ordinary task layout stays unchanged
    • artifacts-cached:Cached cards keep their height while remount stats are pending; confirmation enables them and deletion removes the entire row
    • artifacts-missing:Missing files leave no empty avatar row
    • 未覆盖:Full CCAgentSessionView, login, host execution, document opening, native mobile layout and transport
    • 场景替换的模块(未验证):src/renderer/components/chat/GhostToolCard、src/renderer/contexts/AuthContext

单页验证截图 1/6
单页验证截图 2/6
单页验证截图 3/6
单页验证截图 4/6
单页验证截图 5/6
单页验证截图 6/6

iOS 与 Android 实机截图

手机真实组件,免登录合成数据:iOS 完成/展开与 Android 展开/运行中。
单页验证截图 1/4
单页验证截图 2/4
单页验证截图 3/4
单页验证截图 4/4

怎么验证的

自动验证

  • pnpm --filter desktop exec vitest run src/renderer/__tests__/streamingWorkGroupRender.test.tsx src/renderer/features/bots/__tests__/botChatSurface.test.ts:21/21 通过。
  • pnpm --filter mobile exec vitest run src/__tests__/pluginAttachmentBubble.test.tsx:20/20 通过;与 subagentRender 的 5 项合计 25/25,墙钟 3.01 秒。
  • pnpm --filter desktop typecheck、pnpm --filter mobile typecheck:通过。
  • pnpm ui:check --changed --theme all:36/36 通过,无 uncovered,已目检相关过程、窄栏、话题、成果卡截图。
  • pnpm check:dev-docs、pnpm check:dco、git diff --check:通过。

测试价值:

  • pluginAttachmentBubble.test.tsx 通过生产消息投影及 MessageRenderer 渲染「用户→过程文字→工具→最终回复」,覆盖过去缺失的过程头像及展开后的头像总数。原先断言仅一个头像,现在要求过程和回复各一个;unit,3.45 秒。
  • teammate-process/ui-page.mjs 通过真实 MessageStream / BotAvatar,在运行、完成、展开状态断言头像可见性和数量,防止透明占位冒充头像。复用现有 Electron UI integration 场景;含 36 个变体的整轮运行见上方 UI 报告。
  • botChatSurface.test.ts 仅同步既有接线 guard 的过期预期,不将源码断言作为视觉正确性证据;与 streamingWorkGroupRender 共 5.24 秒。实际头像由上面的真实组件验证。

手工验证

  • Desktop:Electron 单页窗口,运行→完成、折叠→展开、重试、多宽度及成果卡对齐,Light / Dark;窗口已正常退出。
  • iOS:Baguette iPhone 18 Pro,当前工作树 mock Metro;匹配原生缓存安装,sim-up 返回 bundleVerified=true / foreground=true。运行中、完成后、展开工具明细以及 B2B 完成态,深浅色均已查看。
  • Android:Baguette Android Phone,安装当前构建 app-debug.apk;插件 info 返回 matchesLocal=true,adb serial emulator-5554。本工作树 Metro 有新的 Android Bundled 记录;运行中、完成后、展开、B2B,深浅色均已查看。
  • 两端复用相同生产渲染入口;测试数据只在 mock 内存,临时 visualMock 修改已全部恢复,模拟器和本任务 Metro 已退出,保留设备数据。
  • 源码分支 companion-process-avatar,基线 3568430ec3 加本提交七文件;Metro 来自同名工作树,sim-up 核验来源身份。手机界面截图未单独记录 DEV build label,来源以启动回执、包校验和本工作树 bundle 日志交叉核验。

未执行的验证

  • 未做真实账号/远程 Agent 执行,本次只改变头像呈现。完整测试套件交 CI;未逐一截图所有 UI 语言,无新增或修改 UI 文案,Android 额外验证了已有德语长标签。
  • Android 首次首页启动出现 Expo ContextNavigator 的未挂载组件状态更新警告,发生在进入聊天前;再次启动未复现,后两次 logcheck 通过。保留 setLayoutAnimationEnabledExperimental 在新架构下无效果的既有调用警告;不声称所有日志完全无警告。

风险

风险分类

  • 无已知风险

影响与回滚

  • 影响范围:伙伴私聊过程外层,普通任务、群聊及明细渲染逻辑不变;复用现有主题和头像组件。
  • 无数据库、权限、协议或原生指纹改动。
  • 回滚方式:回退本提交。

提交前检查

  • 已 review 完整 diff
  • 每个 commit 都带 DCO 签名
  • UI 变化已注明设计规范
  • 未提交凭证、令牌或授权文件
  • 受影响设计规范已同步
  • 已确认测试结果并说明未执行项

Assisted-by: Cindy (https://cindy.app)

子 Agent 嵌套头像回归与补充验收

已采纳并在 876c8c4 修复。SubagentCard 现在在递归前清空 companionAvatar,其余 actions 保留;子任务工具、正文和摘要仍可正常展开。

新增真实消息投影 → MessageRenderer 回归,旧代码因多出 companion.processRow 失败,修复后通过。pluginAttachmentBubble.test.tsx 与 subagentRender.test.ts 共 25/25 通过(3.01 秒),Mobile typecheck 与 DCO 通过。

iOS、Android 已补测子 Agent → 内部工作组两层展开:内部不再重复主伙伴头像,主回复仍保留头像。临时模拟数据已恢复,测试实例已退出。Android logcheck 通过,保留既有 LayoutAnimation no-op 警告。

子 Agent 递归展开补充验收:iOS 与 Android 真实组件、合成数据,内部工具和摘要不重复主伙伴头像。
单页验证截图 1/2
单页验证截图 2/2

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@zqchris
zqchris requested a review from a team as a code owner November 4, 2026 17:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T17:52:22.247071Z 3613066 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] 本次头像呈现改动看起来可以合并,未发现阻塞问题。

Summary

为桌面、iOS 和 Android 的伙伴私聊补齐过程头像。

  • Partner process groups show the current portrait beside the work.

Reviews (1) · Last reviewed commit: "fix(bots): show partner avatars beside w..." · Reviewed by Greptile

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a95590b1cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Resolve DESIGN.md by retaining the main branch language wording and the partner process/reply avatar contract.

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
@zqchris

zqchris commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

已在 3613066 合并最新主干并解决 DESIGN.md 的唯一冲突:保留主干「各语言」措辞及本 PR 的过程/回复头像规则。六个代码与测试文件逐字未变,PR 仍仅七个原范围文件。pnpm check:dev-docs 10/10、差异检查与 DCO 通过;原头像测试及三端实测证据继续适用,本轮未重启测试实例。已推送,等待新 CI。

@MagicLizi MagicLizi added status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示) labels Nov 4, 2026

@xd-bobo xd-bobo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by compliance check: CI passed and no blocking reviews.

@MagicLizi MagicLizi removed the status:awaiting-bot-review 等外部审查机器人表态(review-pr 自动维护,仅展示) label Nov 4, 2026
@MagicLizi

Copy link
Copy Markdown
Contributor

PR #8864 独立代码审查报告(auto 重档)

PR:fix(bots): 补齐三端伙伴过程与回复头像(https://github.com/makecindy/cindy/pull/8864)
审查 head 3613066b729d20205fef96dcdd108d0142a71aa5 · base a3df9a1cccad016f54010939463e4d0aa31fe229(main)· diffHash 021b91c1…31d1

Findings

  • 无 P0/P1。逐项核验结论:
    • 桌面 MessageStream.tsx:WorkGroupRenderItemView 的 replyColumnSpacer(隐形占位)改为 companionAvatar(真实头像),过程区外层经 withAssistantAvatar 各显示一次头像;renderWorkGroupChild 的 MessageItem 不传 assistantAvatar,展开明细不重复画脸;成果卡仍经 botReplyColumnSpacer(invisible 占位)与正文同列对齐;companionAvatar 仅在 simplifiedBotConversation 传入,普通任务布局逐像素不变。
    • 手机 MessageRenderer.tsx:顶层 work_group 走 companion.processRow 头像行(复用既有 companionAvatarRow/Slot/Content 样式与 COMPANION_AVATAR_* 常量,未新增颜色或尺寸);回复行 companion.replyRow 不变;卡片仍走 companionAvatarInset 对齐。嵌套明细三处递归入口(TeammateProcessContents、WorkGroupCard、SubagentCard)均清空 companionAvatar,展开不会重复头像;iOS / Android 共用此渲染器。
    • Codex 已 Resolve 的 P2(SubagentCard 递归未清头像)由 876c8c4 修复并补最小回归(Agent → 工具 → 子回答),旧代码该用例失败、新代码通过,符合「展开明细不重复头像」约束。
    • 重档危险写法软命中定性:pluginAttachmentBubble.test.tsx 新增用例中的 host.innerHTML = html 为测试桩(把自有 fixture 的 renderClient 输出灌入游离 DOM 断言),不接触用户数据、不新增外发或能力边界,放行。
    • botChatSurface.test.ts 为既有接线 guard,仅同步过期断言(replyColumnSpacer→companionAvatar、头像计数 5 处),未弱化覆盖。

Rule coverage — 读取的规则文件及逐项结论

  • AGENTS.md、docs/dev-rules/development-workflow.md(P0/P1/P2 口径、验证真实性):改动仅头像呈现,无数据库/权限/协议/系统提示词/更新器触碰;验证均实际复跑,见下节。
  • DESIGN.md(UI 强制)§5/§7/§14「伙伴私聊消息下操作」:新增 3 行规则文本与实现一致(过程区与最终回复各一头像、三端一致、复用回复头像尺寸间距与正文列、明细不重复、成果卡对齐);实现复用现有 withAssistantAvatar / companionAvatarRow 语义样式,无硬编码颜色、无自造组件、未新增尺寸。合并提交对 DESIGN.md 的冲突解决保留了主干「各语言」措辞,规则未被本 PR 改松。
  • docs/design-rules/cindy-design-system.md:复用现有头像/间距 primitive,无新增 token。
  • docs/dev-rules/mobile-development.md / remote-and-mobile-adaptation.md:仅共享渲染器展示逻辑,无原生配置、无 runtime fingerprint 变化、不触发冷更;无新增 IPC/推送事件。
  • docs/dev-rules/engineering-conventions.md(测试价值与性能):新增用例为「生产投影 → MessageRenderer」真实入口回归,最小失败输入(Agent→工具→子回答)可复现旧缺陷;单文件 2.7s,符合性能预算。
  • 固定问题 1–9:单一目的(伙伴私聊头像呈现)与 Description 一致;共享符号(companionAvatar 重命名)调用方全量追踪(desktop 1 处传参、mobile 4 处渲染入口);无权限/凭证/数据流变化;无新增依赖;UI 证据与 diff 一致(未下载逐项对照,见 Verification);无文案改动、无术语表影响。

Verification — 实际运行的命令、结果、未执行项及原因

工作树内复跑(完整日志与退出码落在本轮目录):

  • npx vitest run src/renderer/features/bots/__tests__/botChatSurface.test.ts(desktop):EXIT=0,16/16 通过。
  • npx vitest run src/renderer/__tests__/streamingWorkGroupRender.test.tsx(desktop):EXIT=0,5/5 通过。
  • npx vitest run src/__tests__/pluginAttachmentBubble.test.tsx(mobile):EXIT=0,20/20 通过。
  • npx vitest run src/__tests__/subagentRender.test.ts(mobile):EXIT=0,5/5 通过。
  • pnpm typecheck(desktop,tsc --noEmit):EXIT=0;npx tsc --noEmit(mobile):EXIT=0。
  • pnpm check:dev-docs:EXIT=0,10 pass / 0 fail(与 PR 声称一致)。
  • security-scan.mjs --base a3df9a1…(重档专项):依赖漏洞扫描不适用(本 PR 未新增/升级第三方依赖);静态扫描未执行(semgrep 未安装,spawnSync semgrep ENOENT)——不得视为已扫描通过。
  • 未执行:pnpm ui:check 36 变体整轮(Electron 单页集成,作者已跑并附 6 张 light/dark 截图,本次未重跑、未下载渲染逐项对照);真实账号 / 远程 Agent 执行验收。PR 附 iOS/Android 实机截图(light/dark)与子 Agent 嵌套展开截图,与 diff 行为一致,未发现描述不实。
  • CI(GitHub):client-ci、pr-design-basis 均 completed/success。

Intent alignment

  • 原目标(PR 描述):伙伴私聊的工作过程区(运行中与完成后)与最终回复各显示一个当前伙伴头像,桌面 / iOS / Android 一致;展开的中间文字与工具明细不重复显示;成果卡与正文对齐;明确不含头像资产、群聊、普通任务、过程聚合/计时规则、原生配置。
  • 初始实现:a95590b1cf851465a7bf5adabcc16a7ee478e1c3(7 文件:desktop MessageStream + fixture + 两个测试、mobile MessageRenderer + 测试、DESIGN.md),已实际读取该 revision diff。
  • 最终行为(head 3613066):与原目标一致。对照结论:
原目标/初始行为 最终行为与影响 代码/提交证据 变化依据
过程区与回复各一头像、明细不重复 不变;桌面外层 withAssistantAvatar、手机 companion.processRow a95590b → head 的 MessageStream.tsx:3021、MessageRenderer.tsx:3207-3217 同一目标内实现
明细不重复头像(含子 Agent 递归) 初始版 SubagentCard 递归缺口 → 876c8c4 清空 companionAvatar 并补回归 MessageRenderer.tsx:5393、PRRT_kwDOTgdRUs6ztWQD Codex P2 意见,服务于原约束,无扩范围
DESIGN.md 规则同步 合并主干时仅解冲突:保留主干「各语言」措辞 + 本 PR 头像规则 3 行 3613066;git diff 876c8c4e 3613066b 对六个代码/测试文件为 0 行 合并冲突解决,代码逐字未变
不含群聊/普通任务/原生配置 未触碰:simplifiedBotConversation/actions.companion 门控普通任务零差异,无原生配置改动 完整 diff 仅 7 文件 无变化
  • 多轮修复(Codex P2)未改变用户原目标;无无关扩范围;无禁用/绕开验证消除报错的痕迹。
  • 结论:一致,无偏离。

Overall

pass(没有 P0/P1)。 附带说明:机器人静默期超时放行 —— copilot-pull-request-reviewer 与 chatgpt-codex-connector 对当前 head 的意见可能在合并后到达(Codex 对前一 revision 的唯一 P2 thread 已由作者修复并 Resolve,Greptile 5/5 无阻塞)。

@MagicLizi
MagicLizi merged commit a3d54ca into makecindy:main Nov 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

touches:product-ui 改动碰到产品 / UI 面(review-pr 自动维护,仅展示) touches:rules 改动碰到规则 / 规范文档(review-pr 自动维护,仅展示)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants