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:
@@ -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 };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user