feat: edit qdrant workspace collections

This commit is contained in:
2026-08-08 19:56:29 +02:00
parent af1e922a48
commit c3a5621737
15 changed files with 234 additions and 198 deletions
+12 -5
View File
@@ -24,7 +24,12 @@ test("new sessions send the browser-selected workspace, model, provider, and thi
server.use(
http.get("/api/workspaces", () => HttpResponse.json([{
id: "psd-clinical", name: "psd-clinical", file: "psd-clinical.yaml", displayName: "PSD Clinical",
revision: { id: "psd-clinical", commit: "a".repeat(40), blob: "b".repeat(40), snapshotPath: "/snapshot", state: "operational" },
}])),
http.get("/api/workspaces/psd-clinical", () => HttpResponse.json({
workspace: { llm_policy: { allowed: ["zai/glm-5.2"] } },
revision: { id: "psd-clinical", commit: "a".repeat(40), blob: "b".repeat(40), snapshotPath: "/snapshot", state: "operational" },
})),
http.post("/api/sessions", async ({ request }) => {
body = await request.json();
return HttpResponse.json({ id: "s1" });
@@ -341,8 +346,9 @@ test("initial restored workspace waits for its delayed policy before creating a
}));
});
test("initial submit waits for delayed workspace summaries before allowing a confirmed legacy workspace", async () => {
test("initial submit rejects a migration-required workspace after summaries load", async () => {
let body: unknown;
let failure: string | undefined;
let releaseSummaries!: () => void;
let summaryRequestStarted = false;
const summariesMayFinish = new Promise<void>((resolve) => { releaseSummaries = resolve; });
@@ -356,8 +362,10 @@ test("initial submit waits for delayed workspace summaries before allowing a con
await summariesMayFinish;
return HttpResponse.json([{
id: "legacy-workspace", name: "legacy-workspace", file: "legacy-workspace.yaml", displayName: "Legacy workspace",
revision: { id: "legacy-workspace", commit: "a".repeat(40), blob: "b".repeat(40), snapshotPath: "/snapshot", state: "migration_required" },
}]);
}),
http.get("/api/workspaces/legacy-workspace", () => new HttpResponse(null, { status: 409 })),
http.get("/api/models", () => HttpResponse.json({ models: [
{ provider: "deepseek", id: "deepseek-v4-pro", name: "DeepSeek V4 Pro", reasoning: true },
] })),
@@ -367,7 +375,7 @@ test("initial submit waits for delayed workspace summaries before allowing a con
}),
);
const client = new QueryClient({ defaultOptions: { queries: { retry: false } } });
render(<QueryClientProvider client={client}><ComposerFooter /><SteerInput sessionId={null} /></QueryClientProvider>);
render(<QueryClientProvider client={client}><ComposerFooter /><SteerInput sessionId={null} onSessionCreateFailed={(message) => { failure = message; }} /></QueryClientProvider>);
await waitFor(() => expect(summaryRequestStarted).toBe(true));
await userEvent.type(screen.getByRole("textbox", { name: /new question/i }), "q");
@@ -377,9 +385,8 @@ test("initial submit waits for delayed workspace summaries before allowing a con
expect(screen.getByRole("button", { name: /send/i })).toBeDisabled();
releaseSummaries();
await waitFor(() => expect(body).toEqual({
question: "q", workspaceId: "legacy-workspace", provider: "deepseek", model: "deepseek-v4-pro", thinking: "medium",
}));
await waitFor(() => expect(failure).toBe("Could not load selected workspace policy. Please retry."));
expect(body).toBeUndefined();
});
test("failed workspace summaries block creation and report a safe error", async () => {