{{ message }}
Repository navigation
fix(sidebar): 编辑重发后进入分支会话,不再被过期的侧栏刷新抹掉 - #1036
Merged
xiaozhou26 merged 1 commit intoOct 20, 2026
Merged
xiaozhou26 merged 1 commit into
xiaozhou26 merged 1 commit into
Conversation
…eshes Edit-resend creates a branch conversation and upserts it into the sidebar. A first-page refresh issued before the branch existed could land afterwards and reconcile it away; ChatPage then saw the current conversation vanish and opened a new blank chat. Local upserts now carry a sequence number: a first-page response keeps rows upserted after its request started and only settles rows it could have known about. Later refreshes stay authoritative. Closes Stack-Cairn#1034
xiaozhou26
approved these changes
Oct 20, 2026
xiaozhou26
left a comment
Contributor
There was a problem hiding this comment.
Reviewed first-page request/upsert sequencing and authoritative post-upsert reconciliation. Passed stale/queued refresh, scope round trip, workspace history, deletion, failed request, reconnect, stop/start, and repeated-upsert regressions. No blocker found.
Integration review: all five PR heads merged locally without conflicts. Shared UI, GUI and WebUI typechecks passed; GUI frontend 3398 passed / 4 skipped, WebUI 808 passed; both Vite production builds, UI boundaries and diff whitespace checks passed. Browser verification used real shared components with fixture callbacks, not a native Tauri or live-provider end-to-end run. No new release requested.
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.

编辑会话第一条用户消息重发时,分支会话已经创建,界面却停在"新对话"空白页。根因:编辑重发建分支后
sidebarStore.upsertLocal写入分支会话,若此前已发出的侧栏首页刷新在写入之后才返回,reconcileSidebarConversations会把不在结果里、非 pending、非保留的分支会话合并掉;ChatPage发现当前会话从列表消失且未在发送,就自动新建对话。Closes #1034
改动
localUpsertSeq/localUpsertSeqById);首页请求开始时记下当时的序号。结果返回时,晚于该请求的本地写入一律保留(这次结果不可能知道它),早于请求的写入由这次结果决定去留并清除记录。removeLocal同步清除记录,Map 大小不超过会话数。截图
桌面 GUI(调试版真机):编辑首条消息并发送后,3.3 秒内进入新建的分支会话(侧栏选中项带分支图标),全程未出现新对话页。
验证
upstream/v2-kbrian7e6291bgit diff --check通过test/chat/sidebar-store.test.mjs2 条:写入之前发出的刷新晚到时不抹掉分支(修复前 UI 先看到["source"]);写入之后发出且不含它的刷新照常移除。test/chat/sidebar-upsert-seq-probes.test.mjs9 条探针:排队刷新、scope 切换、工作区历史/置顶列表、别处删除、重连、stop/start、频繁写入等路径(其中 3 条修复前失败)。cargo test为 1086 通过 / 23 失败,23 条均为 Windows 基线环境失败,本 PR 不改src-tauri;两条按 CWD 读源码,在crates/agent-gui下重跑通过)totalCount暂时比可见行少 1,下一次刷新纠正(仅显示)。