feat: pin sessions to workspace revisions

This commit is contained in:
2026-08-04 05:05:20 +02:00
parent 90894176b6
commit 301db4bd85
14 changed files with 288 additions and 54 deletions
@@ -0,0 +1,15 @@
import { expect, test } from "vitest";
import { workspacePreferences } from "./preferences";
test("migrates legacy selections once and keeps later browser choices", () => {
localStorage.clear();
expect(workspacePreferences.migrate({
workspaceId: "psd-clinical", provider: "zai", model: "glm-5.2", thinking: "medium",
})).toMatchObject({ workspaceId: "psd-clinical", model: "glm-5.2" });
workspacePreferences.save({ workspaceId: "research", provider: "deepseek", model: "deepseek-v4-pro", thinking: "high" });
expect(workspacePreferences.migrate({ workspaceId: "legacy" })).toMatchObject({
workspaceId: "research", provider: "deepseek", model: "deepseek-v4-pro", thinking: "high",
});
});