Repository navigation
fix(chat): fork visible historical replies outside the live window - #2430
Merged
Merged
Conversation
Reply fork looked up the anchor only in the latest-100 live message window, so a paginated historical assistant reply shown via transcriptViews was a silent no-op. Resolve visible anchors through the same view helper the transcript uses, without copying history onto the live streaming tail.
Collaborator
|
ci error |
Collaborator
|
感谢 @koeria 提交这个 PR,也谢谢你为 PI-Desktop 花的时间!🙏 不过目前 CI 还有一处报错,需要麻烦你再处理一下:
CI 全绿是本仓库的合入硬门槛( ⏳ 超时提醒:本仓库对 CI 未通过的 PR 设有 72 小时超时机制。以本评论发出时刻(2026-11-19 11:50 (UTC+8))起算,截止时间为 2026-11-22 11:50 (UTC+8)。若届时 CI 仍未转绿,该 PR 将进入超时状态并被关闭。 关闭并不等于否定这份贡献——修好后随时可以重新打开或另开 PR 继续推进。如果这个 E2E 失败看起来与本次改动无关(例如环境/权限类问题),或者修复过程中遇到困难,直接在这里回复就好,我们会一起看。 再次感谢你的贡献! |
The Trusted extensions Electron E2E job failed on a standalone browser capture/resize CDP screenshot after 30s. That path is outside this PR's fork-anchor change, and the timeout's root cause is still unknown. This empty commit retriggers normal pull_request CI because failed-job rerun on the previous run requires write access this fork does not have. No product, test, or workflow files are changed.
Contributor
Author
|
@Tioit-Wang 感谢提醒。之前失败的直接原因是独立截图测试中的 CDP 截图调用超过 30 秒,导致没有输出成功标记。该测试不走本 PR 修改的 fork 锚点路径;截图卡住的具体原因尚未确定,也没有证据表明 dbus 日志是原因。 我补了一个空提交触发重跑,没有修改源码或 workflow。新 CI 已于 11 月 19 日 15:51(UTC+8)全部通过,包括之前失败的截图测试;PR base 检查 也已通过。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因 (Root cause)
forkAssistantMessage只在state.messages(默认最新 100 条的实时窗口)里查找分支锚点。分页后仍显示在会话里的历史助手回复来自transcriptViews,因此点击「从此回复创建分支」会静默返回,尽管按钮对可见的已完成助手消息是开放的。这与 #2086 / 已合并的 #2191 不同:本次是可见历史页的锚点查找遗漏,而不是分支会话本身的接线问题。
修复 (Fix)
findVisibleAssistantForkAnchor:先在实时窗口查找(保留当前页与流式尾部路径),找不到再通过 UI 已经使用的transcriptViewMessages解析当前可见页。state.messages,也不会调用loadFullSessionMessages,避免覆盖正在流式输出的源会话尾部。canEditMessages的早退保持不变。验证 (Verification)
apps/desktop单元测试:node --test test/session-fork-running.test.mjs test/session-fork.test.mjs— 14/14 通过。新增回归覆盖:transcriptViews的分页历史助手回复可以分支,且实时 100 条窗口与流式尾部在forkSession调用前后保持不变(含restored的纯历史页,以及未restored的 live-tail 合并路径);loadFullSessionMessages。pnpm check:pr-base通过:origin/main(4ad0094e87b3) 是 HEAD 的祖先。apps/desktop/node_modules/electron/dist/electron),仓库也没有覆盖「分页历史回复上从此处分支」的现成 E2E 场景。完整apps/desktopnode --test test/*.test.mjs为 5195 通过 / 23 失败 / 9 跳过,23 项失败全部是同一缺失 Electron 二进制导致的*-user-path类测试,与本次改动无关。Fixes #2429