Files
Jyotisha/frontend/supabase/migrations/20260906010000_chat_session_context_summary.sql
T
Jesse_Chen bf8ad0d1ff fix(web): keep consultation conclusions across turns and surface cache hits (BUG-555, BUG-556)
Session history was silently clipped to the first 4000 characters of the last 12 messages, so follow-ups could not see timing or audit tables. Keep an append-only tail plus a checkpoint summary, retry overflow in the same request, and expose cache hit rate in admin usage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:16:18 +08:00

11 lines
265 B
PL/PgSQL

begin;
alter table public.chat_sessions
add column if not exists context_summary jsonb null
check (context_summary is null or jsonb_typeof(context_summary) = 'object');
grant update (context_summary)
on table public.chat_sessions to authenticated;
commit;