重构会话管理,简化上下文存储逻辑

This commit is contained in:
2026-06-03 17:14:55 +08:00
parent 76d4b510f4
commit 04ded0ceb0
19 changed files with 420 additions and 235 deletions
+3 -1
View File
@@ -44,9 +44,11 @@ describe("ConversationStore", () => {
const touched = await store.touch(record, {
title: "新标题",
opencodeSessionId: "opencode-session-1",
});
expect(touched.title).toBe("新标题");
expect(touched.opencodeSessionId).toBe("opencode-session-1");
expect(touched.updatedAt >= record.updatedAt).toBe(true);
const fetched = await store.get(
@@ -58,7 +60,7 @@ describe("ConversationStore", () => {
},
"existing-session",
);
expect(fetched?.sessionScopeKey).toBe(record.sessionScopeKey);
expect(fetched?.title).toBe("新标题");
expect(fetched?.opencodeSessionId).toBe("opencode-session-1");
});
});