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:
Schwitzz
2026-10-29 15:03:32 -05:00
parent fc8eaa86c3
commit a1b5587fcb
15 changed files with 181 additions and 60 deletions
+1 -1
View File
@@ -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");
});