feat(chats): add managed projectless chat sessions

Create projectless chat sessions under a managed, date-scoped Chats directory and clean abandoned or deleted session folders.

Add Chats to sidebar state, startup cache, shared context, and Electron Mini Chat while keeping VS Code project-only. Resolve managed chat directories to one server-side memory owner and document the runtime contracts.
This commit is contained in:
Bohdan Triapitsyn
2026-08-21 12:12:40 +03:00
parent 0d70a631f6
commit 9e87d7fdb9
46 changed files with 677 additions and 136 deletions
+7
View File
@@ -3,6 +3,7 @@ import { runBackgroundNetworkTask } from '@/lib/background-network';
import { retry } from "@/sync/retry";
import { stripSessionListDetails } from "@/sync/sanitize";
import { startSessionLoadPerformanceEvent } from "@/sync/session-load-performance";
import { isChatDirectoryPath } from '@/lib/chatDirectories';
export type GlobalSessionRecord = Session & {
project?: {
@@ -12,6 +13,12 @@ export type GlobalSessionRecord = Session & {
} | null;
};
export const filterManagedChatsForRuntime = (sessions: Session[], vscode: boolean): Session[] => (
vscode
? sessions.filter((session) => !isChatDirectoryPath(session.directory))
: sessions
);
const toNumber = (value: string | null): number | null => {
if (!value) {
return null;