saved sessions: replace transient history with persistent DB storage and auto-save

- Add saved_sessions table and CRUD endpoints (save, list, resume, update, delete)
- Save is instant (no LLM summarization), stores exact conversation with tool calls
- Resume loads full message history into chat UI, sends transcript to agent on first message
- Auto-save updates DB after every agent response once a session is saved
- Delete old filesystem-based session/group management (sessions router, useChatSessions, useChatGroups)
- Clean up ChatHeader, SessionList, ChatDetailPanel for saved sessions flow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 13:36:25 +00:00
co-authored by Claude Opus 4.6
parent d88fe3cac7
commit 2a8df0def1
39 changed files with 3272 additions and 2257 deletions
+2 -3
View File
@@ -13,7 +13,6 @@ uploadRouter.post('/', async (ctx) => {
const file = body.file as File | null;
const sessionId = (body.sessionId as string) || null;
const provider = (body.provider as 'claude' | 'pi-mono') || null;
if (!file || !(file instanceof File)) {
return ctx.json({ error: 'file is required' }, 400);
@@ -33,8 +32,8 @@ uploadRouter.post('/', async (ctx) => {
const filename = `${crypto.randomUUID()}.${ext}`;
let saveDir: string;
if (sessionId && provider) {
saveDir = getAttachmentsDir(user.email, provider, sessionId);
if (sessionId) {
saveDir = getAttachmentsDir(user.email, sessionId);
} else {
saveDir = getTmpAttachmentsDir(user.email);
}