Carry conversations into new sessions with a visible summary

- Bots get continue_in_new_session: the bot writes a title and summary,
  the session closes for good (read-only) and the new one opens with the
  summary as a "Carried over from the last session" message that links
  back to the old session.
- Continue in new session (conversation menu, sessions modal) and the
  automatic rollover at the session length do the same; New session now
  starts a fresh, unlinked session.
- Session length is an app setting in Settings > General.
- ?session_id= opens a session; a carried-over one shows a bar linking to
  where the conversation went on instead of the composer.
- The thread can open the previous session above the current one (shown
  only, never in the prompt), and replies get search_past_sessions and
  read_past_session.
- Sessions are named from their opening messages, not their latest, and
  a carried summary is labelled as the earlier session's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-26 05:35:52 +01:00
co-authored by Claude Opus 5.5
parent 1e6833b5d8
commit cc109bc361
64 changed files with 2074 additions and 128 deletions
+29
View File
@@ -997,6 +997,16 @@ export type McpServersOverviewPayload = ExtensionTargets & {
servers: PublicMcpServer[];
};
/**
* How many messages a session takes (Settings > General,
* `grab-bot-session-max-messages.ts`).
*/
export type SessionLengthOverview = {
max_messages: number;
default_messages: number;
max: number;
};
/**
* How long hook calls are kept (Settings > General,
* `grab-hook-events-keep-days.ts`).
@@ -1434,6 +1444,15 @@ export type MessageDetails = {
export type OlderBotMessagesData = {
messages: BotMessageWithAttachments[];
has_more: boolean;
/**
* The session paged, and the one it carries on from (opened above it
* next).
*/
session: {
id: number;
title: string | null;
previous_session_id: number | null;
};
};
export type BotMessageReactionData = {
@@ -1518,6 +1537,11 @@ export type ConversationHistory = {
* far.
*/
task: BotTaskWithSteps | null;
/**
* When the session shown was carried over into a newer one (it stays
* closed, to read): that session. Null otherwise.
*/
moved_to_session_id: number | null;
};
/**
@@ -1691,6 +1715,11 @@ export type PagePropsType = {
* General settings page).
*/
hook_call_retention?: HookCallRetentionOverview | null;
/**
* How many messages a session takes, with the code's default (the
* General settings page).
*/
session_length?: SessionLengthOverview | null;
/**
* The name the install goes by as an installed app (Settings >
* General, and the root's head tags). Empty when never named.