server: reconcile ai_sessions persistence to Chunk 9 AISession shape
Reshape the ai_sessions table (migration 003) and mapping/routes to the full AISession contract: title, kind, notes, created_at, last_message_at; drop legacy role/model/settings. toAISession now maps the new columns and routes create/patch/messages handlers use the new shape.
This commit is contained in:
@@ -97,7 +97,7 @@ describe("NoteBuilder", () => {
|
||||
|
||||
const init = calls[0] as RequestInit;
|
||||
const body = JSON.parse(init.body as string) as Record<string, unknown>;
|
||||
const messages = body.messages as Array<{ content: string }>;
|
||||
const messages = body.messages as Array<{ content: string; role?: string }>;
|
||||
const system = messages.find((m) => m.role === "system")?.content ?? "";
|
||||
expect(system).toContain("The Stolen Relic");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user