Skip to content

[Issue #34] Add conversation lineage foundation and operations - #53

Draft
CC1227871 wants to merge 9 commits into
helsome:mainfrom
CC1227871:fix/issue-34-conversation-lineage
Draft

CC1227871 wants to merge 9 commits into
helsome:mainfrom
CC1227871:fix/issue-34-conversation-lineage

Conversation

@CC1227871

@CC1227871 CC1227871 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Issue #34:对话分支与消息操作

本 PR 按层补齐对话 lineage 与非破坏性操作,当前仍保持 Draft。

  • Phase 1–2: 稳定的 branch/message/run/generation 标识、追加式分支投影、会话 IPC 与持久化运行记录;提供 send、retry、regenerate、edit、fork。
  • Phase 3a–3b: Pi 的 forkget_fork_messagesget_entries 协议支持;子分支隔离及运行时 session/entry/leaf 身份记录。
  • Phase 4a–4b: Copilot 分支选择器、按分支加载 transcript、消息级编辑/重试/重新生成/创建分支,以及 reload 与实时事件去重处理。

可复现验证报告(2026-09-21)

环境:Bun 1.4.2;Microsoft Windows 11 家庭中文版(10.0.22621,Build 22621)。

验证项 命令 / 方式 结果
分支运行上下文聚焦测试 bun test --isolate packages/shared/src/agent/workspace-context.test.ts 3 pass,0 fail,0 skip;9 expect
全仓测试 bun test --isolate 1309 pass,0 fail,8 skip;5998 expect,1317 tests / 146 files
全 workspace 类型检查 bun run typecheck core、i18n、shared、ui、electron 均退出码 0
Electron 生产构建 apps/electron 目录执行 bun run build 通过;Vite 有 chunk 大于 500 kB 的提示,Node 有 module.register() 弃用提示
Electron 分支 UI 手测 Electron 39.8.9;FINAGENT_AGENT_PROVIDER=local,使用隔离的 FINAGENT_USER_DATA_DIR 创建 Fork,确认选择器包含 Main/Fork,并成功 Main ↔ Fork 切换;截图展示消息操作按钮

失败基线与跳过项

初次在本 PR 分支执行全仓测试时为 1306 pass、3 fail、8 skip。3 个失败均是 workspace-context.test.ts 的等待超时:新增运行路径会请求 Pi get_entries,而该文件的 FakePiProcess 未返回此 RPC。对照干净的上游 main 工作树运行同一聚焦命令为 3 pass、0 fail;为 fake 增加 get_entries 的空 entries/leaf 响应后,本分支聚焦测试为 3 pass,全仓测试也变为 1309 pass、0 fail。

8 个 skip:7 个 LongBridge 账户/投资组合 fixture 条件测试(fixture 未配置),以及 1 个 Windows symlink 能力测试(当前环境不支持/无权限创建 symlink)。

实际界面截图

截图来自 Electron 39.8.9 桌面应用及隔离测试配置。测试环境没有配置 LLM API key,因此行情提问显示 “Add an API key to connect”;截图只证明分支和消息操作 UI,不代表真实模型调用,也不声称完成真实多分支 evidence/citation E2E。

分支选择及用户消息编辑/创建分支

分支中的助手消息重新生成/创建分支

完整、配置了真实凭据的 Copilot 多分支 evidence/citation 验证留作后续工作;本 PR 维持 Draft,等待作者决定何时转为 Ready for review。

Related to #34.

@CC1227871 CC1227871 changed the title [Issue #34] Add conversation lineage foundation [Issue #34] Add conversation lineage foundation and operations Sep 11, 2026

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Draft 阶段的 foundation 方向是对的,尤其是 append-only lineage、独立 run/generation identity、retry/regenerate/edit/fork 的非破坏语义。当前先保持 Draft,不建议提前合基础层,因为 #34 的关键闭环还没有完成:

  • 把 Folio branch projection 真正接到 Pi runtime 的 fork/get_fork_messages/get_entries,确保切 branch 后模型上下文本身隔离,而不只是本地 UI/存储投影隔离;
  • branch UI:当前 branch 可见、regenerate alternatives 可切换、failed/cancelled 可正确 retry、历史 branch 可返回;
  • reload 后验证 branch/message/run lineage、workspace snapshot、tool/citation/evidence 都恢复且不串 branch;
  • 用 Bun 跑 unit/integration + 当前仓库 CI。现在“环境没有 Bun”不能作为 ready-to-merge 的最终验证;
  • #34 做真实 Copilot E2E:生成回答 → regenerate → 编辑早期问题 → fork → 两个 branch 分别产生不同 tool/evidence,并证明 reload 后引用和 tool state 仍严格隔离。

这些完成后再 Ready for review。当前不要求推翻已有 3 个 phase,重点是把 runtime/UI/真实 E2E 接成完整闭环。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

补充更新一下审核标准:上一轮对 #34 的验收要求偏严。你现在已经补到 Phase 3b / 4a / 4b,runtime branch isolation、branch switching、edit/regenerate/retry/fork 的 UI 与 smoke coverage 都已经形成完整骨架。真实 Copilot 的完整多分支 evidence/citation 演示可以作为后续验证,不再要求一次性做到极致。当前继续保持 Draft 主要是尊重作者状态;等你认为实现 ready、标记 Ready for review 后,只要基础 unit/typecheck/关键 smoke 能通过、没有明显 branch 串线或 destructive overwrite 问题,就可以按可合增量处理。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

补充当前贡献验收要求(你这条仍是 Draft,所以先不做强制 Request Changes):转 Ready for review 前,请把验证材料整理成可复现的测试报告,而不是只写“passes”。至少包含实际命令、Bun/OS、pass/fail 数量、失败基线说明。

另外这条已经修改了 BranchSwitcherAgentPanelTurnCard 等可见 UI,Ready 前请贴至少一张实际修改后截图;最好覆盖 branch switching / edit-regenerate-fork 相关界面。已有界面改造优先 Before/After。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants