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:
@@ -30,10 +30,9 @@ export const scrapeRouter = createRouter();
|
||||
|
||||
scrapeRouter.post('/', async (ctx) => {
|
||||
const user = ctx.get('user');
|
||||
const { url, sessionId, provider } = ctx.get('body') as {
|
||||
const { url, sessionId } = ctx.get('body') as {
|
||||
url: string;
|
||||
sessionId?: string;
|
||||
provider?: 'claude' | 'pi-mono';
|
||||
};
|
||||
|
||||
if (!url) return ctx.json({ error: 'url is required' }, 400);
|
||||
@@ -140,9 +139,9 @@ scrapeRouter.post('/', async (ctx) => {
|
||||
let attachmentId: string;
|
||||
let saveDir: string;
|
||||
|
||||
if (sessionId && provider) {
|
||||
if (sessionId) {
|
||||
attachmentId = `${slug}.html`;
|
||||
saveDir = getAttachmentsDir(user.email, provider, sessionId);
|
||||
saveDir = getAttachmentsDir(user.email, sessionId);
|
||||
} else {
|
||||
attachmentId = `${crypto.randomUUID()}.html`;
|
||||
saveDir = getTmpAttachmentsDir(user.email);
|
||||
|
||||
Reference in New Issue
Block a user