fix(train): #697 测试 harness 适配 #776 的 mounted 观测——会话列表从来沒有 current 字段(AGENTS §3.4.9)

This commit is contained in:
HuanLinOTO committed 2026-10-01 17:25:16 +08:00
1 parent 84d89067d4
commit aa82c4aed7
1 file changed
+12 -1
+12 -1
View File
@@ -28,12 +28,23 @@ describe('createNativeSurface cross-session opens', () => {
openResource: vi.fn(),
openResourceIn: vi.fn(),
close: vi.fn(),
// #776: the mounted-seat observation (`ISidebarRight.mounted`) is the
// only sanctioned on-screen-session source (the session list has NO
// `current` field in any DSH release — AGENTS §3.4.9).
mounted: {
getSnapshot: () => list.current,
subscribe: (fn: () => void) => {
notify = fn
return () => { notify = undefined }
},
},
}
const ctx = {
get: () => controller,
sessions: {
list: {
getSnapshot: () => ({ current: list.current }),
// No `current` field: the real SessionListState never had one.
getSnapshot: () => ({}),
subscribe: (fn: () => void) => {
notify = fn
return () => { notify = undefined }