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
+13
View File
@@ -31,6 +31,19 @@ test("GET /settings returns effective defaults (env provider/model/thinking, fir
}
});
test("GET /settings uses the stored installation workspace default before the harness fallback", async () => {
const { app, dir } = appWithTmpSettings({});
try {
writeFileSync(join(dir, "settings.json"), JSON.stringify({ workspace: "psd-clinical" }));
const response = await app.inject({ method: "GET", url: "/settings" });
expect(response.json()).toMatchObject({ workspace: "psd-clinical" });
} finally {
rmSync(dir, { recursive: true, force: true });
}
});
test("PUT /settings does not persist personal workspace or LLM choices", async () => {
const { app, dir } = appWithTmpSettings({ PI_PROVIDER: "zai", PI_MODEL: "glm-5.2", PI_THINKING: "medium" }, {
listModels: async () => [{ provider: "zai", id: "glm-5.2", name: "GLM 5.2", reasoning: true }],