Name sessions with the model and keep the rail list live
Sessions no longer take their title from the first message: once the first exchange is sent, the text model writes the title and summary, which the rail and sessions list show. The summary records how many messages it covers so a stale one is rewritten before it is carried into the next session. The sessions hook now reloads on live message and session events, so a session started by the first message, a rollover or another tab appears without a reload. New sessions are pushed as server:bot-session, both from the process that changed them and through the live relay.
This commit is contained in:
+7
-2
@@ -305,14 +305,19 @@ const schema: BUN_SQLITE_DatabaseSchemaType = {
|
||||
},
|
||||
{
|
||||
fieldName: "title",
|
||||
fieldDescription: `From the first user message`,
|
||||
fieldDescription: `Written by the bot from the session's first exchange`,
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "summary",
|
||||
fieldDescription: `What happened in the session (markdown), written by the bot when the next one starts and carried into it`,
|
||||
fieldDescription: `What happened in the session (markdown), written by the bot and refreshed as it goes, then carried into the next one`,
|
||||
dataType: "TEXT",
|
||||
},
|
||||
{
|
||||
fieldName: "summary_message_count",
|
||||
fieldDescription: `How many of the session's messages the summary covers, so a stale one is rewritten before it's carried into the next session`,
|
||||
dataType: "INTEGER",
|
||||
},
|
||||
{
|
||||
fieldName: "previous_session_id",
|
||||
fieldDescription: `The session this one carries on from (its summary goes into the prompt). Not a foreign key`,
|
||||
|
||||
+6
-2
@@ -232,13 +232,17 @@ export type BUN_SQLITE_COBBLE_BOT_SESSIONS = {
|
||||
*/
|
||||
workspace_id?: number | "";
|
||||
/**
|
||||
* From the first user message
|
||||
* Written by the bot from the session's first exchange
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* What happened in the session (markdown), written by the bot when the next one starts and carried into it
|
||||
* What happened in the session (markdown), written by the bot and refreshed as it goes, then carried into the next one
|
||||
*/
|
||||
summary?: string;
|
||||
/**
|
||||
* How many of the session's messages the summary covers, so a stale one is rewritten before it's carried into the next session
|
||||
*/
|
||||
summary_message_count?: number | "";
|
||||
/**
|
||||
* The session this one carries on from (its summary goes into the prompt). Not a foreign key
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user