use 16 character random string for session ID

This commit is contained in:
perf3ct 2025-04-06 19:14:16 +00:00
parent 023f0b607d
commit bbd81f6ef1
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -8,9 +8,8 @@ import * as aiServiceManagerModule from "./ai_service_manager.js";
import becca from "../../becca/becca.js"; import becca from "../../becca/becca.js";
import vectorStore from "./embeddings/index.js"; import vectorStore from "./embeddings/index.js";
import providerManager from "./providers/providers.js"; import providerManager from "./providers/providers.js";
// @ts-ignore
import { v4 as uuidv4 } from 'uuid';
import options from "../../services/options.js"; import options from "../../services/options.js";
import { randomString } from "../utils.js";
// Define interfaces for the REST API // Define interfaces for the REST API
export interface NoteSource { export interface NoteSource {
@ -715,7 +714,7 @@ class RestChatService {
const options: any = req.body || {}; const options: any = req.body || {};
const title = options.title || 'Chat Session'; const title = options.title || 'Chat Session';
const sessionId = uuidv4(); const sessionId = randomString(16);
const now = new Date(); const now = new Date();
// Initial system message if provided // Initial system message if provided