feat(backend): bound the messages kept per project

A project that lives for months would otherwise grow the SQLite file without
limit, even though the model only ever reads the most recent messages. Pruning
the oldest rows on every write keeps a project to a fixed budget without
touching what the context is built from.
This commit is contained in:
BlackAngelTV committed 2026-10-05 21:39:45 +02:00
1 parent c1d6593c35
commit 6ebf550eb0
6 files changed
+150 -5

No files matched your search

+4 -1
View File
@@ -19,9 +19,12 @@ export async function startServer(options = {}) {
dbPath: ':memory:',
ollamaUrl: mock.url,
ollamaModel: 'mock:1',
maxMessagesPerProject: options.maxMessagesPerProject,
});
const db = createDatabase(config.dbPath);
const db = createDatabase(config.dbPath, {
maxMessagesPerProject: config.messages.maxPerProject,
});
const ollama = createOllama(config);
const app = await buildApp({ config, db, ollama });