fix(consult): drop traces, budget checkpoints, silent summary inherit
BUG-729: dropped history rounds leave an omission marker in the model-visible summary slot. BUG-730: checkpoint threshold is 0.4 of historyBudgetChars (128k still 16,000). BUG-731: session_full new chat copies owned context_summary on the server; clients send only continued_from_session_id.
This commit is contained in:
@@ -59,6 +59,7 @@ export const chatSessionCreateSchema = z.object({
|
||||
messages: z.array(chatMessageSchema).max(0),
|
||||
session_type: z.enum(["consultation", "birth_time_rectification"]),
|
||||
rectification_case_id: z.string().uuid().nullable(),
|
||||
continued_from_session_id: z.string().uuid().optional(),
|
||||
...chartBindingSchema,
|
||||
updated_at: z.string().datetime().optional(),
|
||||
}).strict();
|
||||
@@ -148,11 +149,41 @@ export type ChatSessionCreate = Readonly<{
|
||||
messages: readonly [];
|
||||
session_type: "consultation" | "birth_time_rectification";
|
||||
rectification_case_id: string | null;
|
||||
continued_from_session_id?: string;
|
||||
chart_profile_id?: string | null;
|
||||
chart_profile_name?: string | null;
|
||||
chart_profile_role?: "self" | "other" | null;
|
||||
}>;
|
||||
|
||||
export type ChatSessionCreateInsertValues = Readonly<{
|
||||
title: string;
|
||||
theme: ConsultationDomain;
|
||||
model_id: string;
|
||||
messages: readonly unknown[];
|
||||
session_type: "consultation" | "birth_time_rectification";
|
||||
rectification_case_id: string | null;
|
||||
chart_profile_id?: string | null;
|
||||
chart_profile_name?: string | null;
|
||||
chart_profile_role?: "self" | "other" | null;
|
||||
}>;
|
||||
|
||||
export function chatSessionCreateInsertRow(input: {
|
||||
id: string;
|
||||
userId: string;
|
||||
values: ChatSessionCreateInsertValues;
|
||||
inheritedSummary?: unknown;
|
||||
updatedAt: string;
|
||||
}): Record<string, unknown> {
|
||||
const row: Record<string, unknown> = {
|
||||
id: input.id,
|
||||
user_id: input.userId,
|
||||
...input.values,
|
||||
updated_at: input.updatedAt,
|
||||
};
|
||||
if (input.inheritedSummary) row.context_summary = input.inheritedSummary;
|
||||
return row;
|
||||
}
|
||||
|
||||
export type ChatSessionWrite = Readonly<{
|
||||
title: string;
|
||||
theme: ConsultationDomain;
|
||||
|
||||
Reference in New Issue
Block a user