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
@@ -164,7 +164,7 @@ export class SuggestionBuilder {
const cleaned = text.trim();
const firstLine = cleaned.split(/\r?\n/).find((l) => l.trim().length > 0) ?? "";
const title = firstLine.replace(/^#+\s*/, "").trim().slice(0, 120) || `${kind} suggestion`;
const summary = cleaned.split(/\r?\n\r?\n/)[0].replace(/^#+\s*/, "").trim().slice(0, 300);
const summary = cleaned.split(/\r?\n\r?\n/)[0]!.replace(/^#+\s*/, "").trim().slice(0, 300);
return { title, summary, text: cleaned };
}
}