session kind: ChatRecord.kind teach|practice (absent = teach)

Practice sessions (owner, 2026-10-04): the marker rides the record and
the normalized summary (absent field reads as teach — pre-practice
records never migrate); POST /api/chats accepts {kind: 'practice'}.
The agent branch, tools, and UI land in the following slices.
This commit is contained in:
amosblomqvist
2026-10-04 21:36:14 +03:00
parent 814c2ad412
commit 7dcb006cf3
6 changed files with 71 additions and 4 deletions
+5 -2
View File
@@ -17,9 +17,12 @@ export async function GET() {
}
export async function POST(req: Request) {
const body = (await req.json().catch(() => ({}))) as { title?: unknown };
const body = (await req.json().catch(() => ({}))) as { title?: unknown; kind?: unknown };
const title = typeof body.title === "string" ? body.title : "";
const chat = createChat(titleFromPrompt(title || "Untitled session"));
// Practice sessions (owner, 2026-10-04): kind "practice" marks the
// record — the practice agent + its tools from turn 1, no extraction.
const kind = body.kind === "practice" ? ("practice" as const) : undefined;
const chat = createChat(titleFromPrompt(title || "Untitled session"), kind);
// PER-SESSION MODELS (owner, 2026-09-28): a session owns its model +
// thinking level from birth — stamped verbatim from the STRONG slot,
// the new-session default. From here the strong slot never reaches