5 Commits
Author SHA1 Message Date
hahachait b2d8109019 padhle - post migration 2026-09-15 04:08:55 -04:00
hahachait 534b51b41b feat: rolling conversation summary + session continuity
- Backend emits session id in SSE; frontend sets activeChat so follow-ups
  reuse the same session (fixes fragmented history).
- sessions.summary column; messages past RECENT_LIMIT (10) are folded into
  a persisted summary via a non-streaming model call.
- buildMessages sends system(+summary) + last 10 messages, bounding context
  while preserving long-range memory.
- Tests: aiMessages (capping + summary injection).
2026-08-19 10:23:56 -04:00
hahachait 00a181134d fix: include current user message in AI context
Persist the user message before streaming so the model receives the
current question (previously only the system prompt was sent on new
chats, causing canned greetings). Also fixes user message being lost
when the AI call errors.
2026-08-19 09:51:41 -04:00
hahachait ff9da4d324 feat: auth, persistence, and AI integration
- Cookie-based auth via backend proxy (httpOnly JWTs)
- Supabase Postgres persistence for sessions/messages/profiles + RLS
- Fix cross-user session leak (token cache keyed by full token, not 50-char prefix)
- Fix missing table grants (42501) via migration; auto-provision profiles on user creation
- Chat validation, ownership checks, rate limiting, /api/chat/sessions route ordering
- Frontend auth-state reset + credentials include
- OpenRouter AI provider (OpenAI-compatible base URL, reasoning disabled)
- Tests: chatValidation, appState
2026-08-19 09:41:40 -04:00
hahachait 93a35a7343 added: grade, subject and chapter in new chat, fixed that shitty card bug 2026-08-18 04:44:10 -04:00