Allow message retries for "pending" status, refactor message context handling, remove workspace import/export routes, and add SQLite-backed rate limiting.
This commit is contained in:
+4
-1
@@ -235,9 +235,12 @@ test("conversation memory exposes context estimates and supports validated summa
|
||||
const repo = server.app.locals.repositories;
|
||||
const chat = repo.createChat("memory-editor", "Memory");
|
||||
repo.createChatMemory("memory-editor", chat, "Prefers concise answers.");
|
||||
repo.updateChatContextSummary(chat.id, "memory-editor", "Old summary", 0);
|
||||
const userMessage = repo.insertChatMessage(chat.id, "user", "I prefer short answers.");
|
||||
const assistantMessage = repo.insertChatMessage(chat.id, "bot", "I will keep them concise.", null, null, "complete", null, Number(userMessage.lastInsertRowid));
|
||||
repo.updateChatContextSummary(chat.id, "memory-editor", "Old summary", Number(assistantMessage.lastInsertRowid));
|
||||
const loaded = (await request(server.baseUrl, `/chats/${chat.id}/memories`, {jar})).json;
|
||||
assert.equal(loaded.summary, "Old summary"); assert.ok(loaded.context.estimatedTokens > 0);
|
||||
assert.deepEqual(loaded.summarySources.map(message => message.content), ["I prefer short answers.", "I will keep them concise."]);
|
||||
const update = body => request(server.baseUrl, `/chats/${chat.id}/summary`, {method: "PUT", jar, body});
|
||||
assert.equal((await update({summary: "Corrected summary", previousSummary: "Old summary"})).status, 200);
|
||||
assert.equal(repo.getChat(chat.id, "memory-editor").context_summary, "Corrected summary");
|
||||
|
||||
Reference in New Issue
Block a user