🐛 fix(vscode): 别的机器上开的会话在本机没有会话文件时,会话 id 行置灰不可双击,不再 resume 报错

This commit is contained in:
cruldra committed 2026-09-24 19:22:29 +08:00
1 parent 2b1e660cc8
commit bf4661e364
20 files changed
+508 -234

No files matched your search

+9 -12
View File
@@ -153,12 +153,14 @@ describe('payloads', () => {
profiles: {},
worktreePath: '/wt',
worktreeExists: true,
missingSessionIds: [],
})).toEqual({
handoffAttachmentId: null,
handoffFrom: null,
sessionId: 's',
worktreePath: '/wt',
worktreeExists: true,
missingSessionIds: [],
})
})
it('接管 UI patch:无 worktreePath 时显式置 null,不留旧值', () => {
@@ -166,35 +168,30 @@ describe('payloads', () => {
sessions: { sessionId: 's' },
profiles: {},
worktreeExists: false,
missingSessionIds: [],
})).toEqual({
handoffAttachmentId: null,
handoffFrom: null,
sessionId: 's',
worktreePath: null,
worktreeExists: false,
missingSessionIds: [],
})
})
it('接管 UI patch:带 reviewSessionFileExists 时一并下发,UI 不用等下次刷新才能点链接', () => {
it('接管 UI patch:缺失的会话 id 原样下发,UI 立刻知道哪几行不能 resume', () => {
expect(handoffAcceptedUiPatch({
sessions: { reviewSessionId: 'r' },
sessions: { sessionId: 's', reviewSessionId: 'r' },
profiles: {},
worktreeExists: false,
reviewSessionFileExists: true,
missingSessionIds: ['r'],
})).toEqual({
handoffAttachmentId: null,
handoffFrom: null,
sessionId: 's',
reviewSessionId: 'r',
worktreePath: null,
worktreeExists: false,
reviewSessionFileExists: true,
missingSessionIds: ['r'],
})
})
it('接管 UI patch:reviewSessionFileExists 未传时不出现在 patch 里', () => {
const patch = handoffAcceptedUiPatch({
sessions: { sessionId: 's' },
profiles: {},
worktreeExists: false,
})
expect(patch).not.toHaveProperty('reviewSessionFileExists')
})
})