bf8ad0d1ff
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>
11 lines
265 B
PL/PgSQL
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;
|